Welcome to iraf.net Thursday, March 28 2024 @ 05:06 PM GMT


 Forum Index > Help Desk > Misc New Topic Post Reply
 from IRAF to UNIX
   
AndrewS
 06/10/2011 02:22PM (Read 4117 times)  
++---
Junior

Status: offline


Registered: 10/10/2010
Posts: 33
my first exposure to scripting has been through IRAF.
I now need to write part of a script for UNIX but don't know anything about the syntax or programming language of UNIX!!can someone please tell me how to set up the equivelant command in a UNIX shell to the following IRAF script:list=list.txt
while (fscan(list,s1) !=EOF){
print (s1)
}Specifically I would like to know what the UNIX equivelant to IRAF's list variable and also the UNIX syntax for while loop and finally what is the task equiveland to fscan?Thanks

 
Profile Email
 Quote
AndrewS
 06/10/2011 02:22PM  
++---
Junior

Status: offline


Registered: 10/10/2010
Posts: 33
the question I posed in my last post may not have been exactly the question that I want answered!...What I really want is the following:I am writing a script in IRAF and it uses the IRAF string variable s1 to read sequential entries from a text file, in the kind of format that I showed in my last post...However, there is a part of my script that requires the value from s1, but in a UNIX command, that is to say that I wish to make a directory with the same name as that stored in s1. However the following will not work:!mkdir (s1)as you cannot use an IRAF variable in a UNIX command. so really what I want to do is to assign the value of s1 to a UNIX variable.One way I can think of doing this is to copy the value of s1 into a textfile by:print (s1, > "value.txt")and then through some UNIX operations, assigning this value to a UNIX variable..As I already said I do not know how to use UNIX so do not have the foggiest on how to begin with assigning this value to the variable.
However, assuming that this step could be completed then it would be a simple matter of using the command:!mkdir $UNIXvariableSo to summarise, my question is how can I assign a value in a text file to a UNIX variable?Also note, the reason this problem arose for me is that mkdir is a UNIX task, if there were an equivelant IRAF task then the problem would be solved immediately. so question 2 - is there such a task?

 
Profile Email
 Quote
fitz
 06/10/2011 02:22PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Unix scripting is beyond the scope of this forum and covers a variety of scripting languages and tools. I recommend you simply Google "intro unix script" to get started, e.g.http://www.doc.ic.ac.uk/~wjk/UnixIntro/Lecture8.html
http://steve-parker.org/sh/sh.shtml
https://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/unixscripting/unixscripting.htmlare all good starting points.

 
Profile Email
 Quote
   
Content generated in: 0.11 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