getting arguments 
Author Message
 getting arguments

Hello,
I would like to know if there is a more direct way to get arguments. I

#------------------------cut here----------------------------------
#!/bin/sh
REG_NAME=`awk '/^#QSUB/ {
  where = match($0,"-r *.*")
  if (where){
    split(substr($0,where,length($0)),options," ")
    print options[2]
  }
  } ' $1`
REG_FILE=`awk '/^#QSUB/ {
  where = match($0,"-o *.*")
  if (where){
    split(substr($0,where,length($0)),options," ")
    print options[2]
  }
  } ' $1`
echo "name=$REG_NAME"
echo "file=$REG_FILE"
#------------------------cut here-------------------------------------
where I'm looking for the arguments given to the command qsub options -r
and -o. In fact in the file
given in argument of this shell script contains lines like that:
#QSUB -r toto -lT 120
...
#QSUB -o file_name -me
...
I would like to retreive "toto" and "file_name"
Thanks a lot in advance for any suggestion,
Thierry
--

SAFEGE-CETIIS                          Tel. : (33) 4 42 93 65 10
Aix Metropole Bt D/30, av Malacrida    Fax  : (33) 4 42 93 65 15
FR 13100 Aix-en-Provence



Sun, 20 Feb 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Getting arguments passed from a process

2. Getting Arguments from Netscape

3. getting argument names from a function

4. when a ruby script gets arguments passed to it.....

5. Getting CGI arguments as scalars

6. Getting subroutine argument info from library

7. Passing parameters and getting the arguments

8. Getting link arguments for embedding Python in C

9. Getting the argument names passed to a function ?

10. Getting information about function arguments?

11. getting number of arguments of builtin/C func

12. dpsh/dpwish arguments not getting passed

 

 
Powered by phpBB® Forum Software