1C.Linux system commands

The 1C:Enterprise developers forum

People who like this:0Yes/0No
Active user
Rating: 2
Joined: Aug 28, 2015

How can i execute a system command on Linux from 1C? The task is to execute the following command:
udevadm info --query=all --name=/dev/sda | grep ID_SERIAL_SHORT
and to get hard drive serial number from 1C. I will be grateful for any help!

People who like this:0Yes/0No
Rating: 13
Joined: Oct 3, 2019

Hello Samir,

you can try to do something like this:

System("udevadm info --query=all --name=/dev/sda | grep ID_SERIAL_SHORT >> temp.txt");
textReader = New TextReader;
line = textReader.ReadLine();
While line <> Undefined Do 

That is, first we give the command to write the serial number of the disk to the file, and then we read the data from this file.

Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.