Welcome to iraf.net Monday, May 20 2024 @ 11:17 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Unix commands in iraf.
   
dbrenner
 07/22/2009 04:29PM (Read 2699 times)  
++++-
Regular Member

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

 
Profile Email
 Quote
Jason Quinn
 07/22/2009 04:29PM  
+++++
Active Member

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

 
Profile Email
 Quote
fitz
 07/22/2009 04:29PM  
AAAAA
Admin

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

 
Profile Email
 Quote
nwj781
 07/22/2009 04:29PM  
+----
Newbie

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//"......."

 
Profile Email
 Quote
dbrenner
 07/22/2009 04:29PM  
++++-
Regular Member

Status: offline


Registered: 05/05/2006
Posts: 115
Thanks guys.

 
Profile Email
 Quote
   
Content generated in: 0.19 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login