Welcome to iraf.net Monday, May 20 2024 @ 11:17 PM GMT
dbrenner |
07/22/2009 04:29PM (Read 2699 times)
|
|
|
Status: offline
Registered: 05/05/2006
Posts: 115
|
I know I can do this
cd "tmp"but can I do something like thisstring dirnamedirname = "tmp"cd dirname ?thanks
|
|
|
|
Jason Quinn |
07/22/2009 04:29PM
|
|
|
Status: offline
Registered: 04/07/2006
Posts: 175
|
From within IRAF you can run UNIX command by escaping them with an exclaimation mark (aka a "bang").For example "!ls -l *.fits" would give you a long listing of all the fits files.If you look in your default login.cl file, you'll see some examples of how to define "foreign" tasks. That's probably what you are after.Jason
|
|
|
|
fitz |
07/22/2009 04:29PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Try[code:1:efa3f22d67]cd (dirname)[/code:1:efa3f22d67]Foreign commands pass their arguments directly and the unix 'cd' doesn't know from the iraf 'dirname' value, but if you use "program mode" as above then the CL interprets the value ('tmp') before executing the command. Note this works with iraf logicals as well, e.g.[code:1:efa3f22d67]cd ("tmp$")[/code:1:efa3f22d67]will put you /tmp, but if dirname="tmp" it will put you in the 'tmp' subdirectory of where you currently are.-Mike
|
|
|
|
nwj781 |
07/22/2009 04:29PM
|
|
|
Status: offline
Registered: 05/08/2008
Posts: 13
|
try this[code:1:e44a5cc5b4]string command
string dirnamedirname = "tmp"
command = "cd "//dirname
print(command) | cl[/code:1:e44a5cc5b4]the double slash just means put the string variable after the explicitly defined string. Any variable you want can be put into the command string as follows:"......"//variablename//"......."
|
|
|
|
dbrenner |
07/22/2009 04:29PM
|
|
|
Status: offline
Registered: 05/05/2006
Posts: 115
|
Thanks guys.
|
|
|
|
| |
|
Content generated in: 0.19 seconds |
|