You can run Linux commands from st.cmd with the "system" command:
system "echo 113 > /sys/class/gpio/export"
However, the iocsh "system" command is not enabled by default for security reasons. This is from the IOC Application Developers Guide:
***************************************************
system command_string
Send command_string to the system command interpreter for execution. This command is present
only if some application database definition file contains registrar(iocshSystemCommand)
and if the system provides a suitable command interpreter (vxWorks does not).
***************************************************
Mark
________________________________
From: [email protected] [[email protected]] on behalf of Amien Crombie [[email protected]]
Sent: Thursday, February 20, 2014 7:09 AM
To: [email protected]
Subject: Running Linux commands inside 'st.cmd'
Hi
I have the following ‘st.cmd’
#!../../bin/linux-arm/ioc48
< envPaths
cd ${TOP}
## Want to add the ‘echo’ Linux command but it fails
## echo 113 > /sys/class/gpio/export
dbLoadDatabase "dbd/ioc48.dbd"
ioc48_registerRecordDeviceDriver pdbbase
int32DriverInit("int32",-32768,32767)
dbLoadTemplate "db/iocPV.substitutions"
set_savefile_path("../save")
set_pass1_restoreFile("channelmap.sav")
set_pass1_restoreFile("channelspacing.sav")
save_restoreSet_DatedBackupFiles(1)
save_restoreSet_NumSeqFiles(3)
save_restoreSet_SeqPeriodInSeconds(6000)
save_restoreSet_RetrySeconds(120)
cd ${TOP}/iocBoot/${IOC}
iocInit
dbpf devx:range 1
Either EPICS’s st.cmd cannot run Linux commands or I’m doing something wrong.
Thanks
Amien
Cape Town
Mogamad Amien Crombie
NRF : iThemba LABS
EIT Group
Laboratory for Accelerator Based Sciences
Somerset West, Western Cape
South Africa
[cid:[email protected]]
- Replies:
- RE: Running Linux commands inside 'st.cmd' Amien Crombie
- Re: Running Linux commands inside 'st.cmd' Andrew Johnson
- References:
- Running Linux commands inside 'st.cmd' Amien Crombie
- Navigate by Date:
- Prev:
Running Linux commands inside 'st.cmd' Amien Crombie
- Next:
RE: Running Linux commands inside 'st.cmd' Amien Crombie
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
<2014>
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Running Linux commands inside 'st.cmd' Amien Crombie
- Next:
RE: Running Linux commands inside 'st.cmd' Amien Crombie
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
<2014>
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|