B
B
Bogdan2019-04-04 20:58:43
Lazarus
Bogdan, 2019-04-04 20:58:43

RunCommand new syntax?

RunCommand writes warning that deprecated. I googled the solution that you already need to use 3 parameters there, but it’s not clear how to rewrite just such a command. She pulls out the hard drive serial number from me

lcCommand := 'sh -c "echo '+ cPasswordSystem +' | sudo -S hdparm -I /dev/sda | grep -i ''serial number''"';
RunCommandlcCommand, lcResultCommand);

I tried to do it like this (so far only the first part would work)
RunCommand('/bin/bash', ['-c', 'echo', cPasswordSystem, '|', 'sudo', '-S', 'hdparm', '-I', '/dev/sda' ], lcResultCommand);

But it returns an empty result.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question