Owner of file to string

29 views
Skip to first unread message

toffe...@googlemail.com

unread,
Mar 9, 2021, 4:43:07 PM3/9/21
to pinnacle3-users
Hi,

I am trying to write a script which can determine the owner of a file and then place that into a string which can then be used in the script.

Does anyone know how to do this?

Thanks

Aled

e_le...@yahoo.ca

unread,
Mar 14, 2021, 11:47:06 AM3/14/21
to pinnacle3-users
You can try:

SpawnCommand = "echo 'Store.StringAt.FileOwner = \"' > '/home/p3rtp/TempScript'";

SpawnCommand = "stat -c '%U' '/home/p3rtp/PinnacleInit' >> '/home/p3rtp/TempScript'";

SpawnCommand = "echo '\";' >> '/home/p3rtp/TempScript'";

Script.ExecuteNow = "/home/p3rtp/TempScript";

SpawnCommand = "rm '/home/p3rtp/TempScript'";

InfoMessage = Store.StringAt.FileOwner;


I hope that helps


e_le...@yahoo.ca

unread,
Mar 14, 2021, 5:35:08 PM3/14/21
to pinnacle3-users
of course you can combine the first 3 lines into one:

SpawnCommand = "echo 'Store.StringAt.FileOwner = \"'\`stat -c '%U' '/home/p3rtp/PinnacleInit'\`'\";' > '/home/p3rtp/TempScript'";

Script.ExecuteNow = "/home/p3rtp/TempScript";

SpawnCommand = "rm '/home/p3rtp/TempScript'";

InfoMessage = Store.StringAt.FileOwner;


I think that is better


Reply all
Reply to author
Forward
0 new messages