UNIX experts / shel...
 

Subscribe now and choose from over 30 free gifts worth up to £49 - Plus get £25 to spend in our shop

[Closed] UNIX experts / shell. help - whats this doing?

7 Posts
6 Users
0 Reactions
45 Views
Posts: 0
Free Member
Topic starter
 

long story short, did some ksh in the past, been roped into this, but have never seen this before in a ksh:

# Utility:Run:No. Var:Var.1:Var.2:Var.3:Var.4:Var.5:Var.6
##
#
# Remove the /apps/1/confg/s/sers directory
#
r_dir:Y:4:/apps/1/confg/s/sers

is it calling another shell script with the paramers Y 4 /apps/1/confg/s/sers ?
whats the purpose of the ':' why not the normal way of
r_dir Y 4 /apps/1/config/s/sers

or is this ksh file being read by something else and the ':' is a delimeter???

any help much appreciated.


 
Posted : 08/01/2013 1:41 pm
Posts: 8177
Free Member
 

is it calling another shell script with the paramers Y 4 /apps/1/confg/s/sers ?

That, I think. Is there a script called r_dir somewhere?


 
Posted : 08/01/2013 1:46 pm
Posts: 0
Free Member
Topic starter
 

more google searching - wonder if its something to do with 'getopts' and using ':' ?


 
Posted : 08/01/2013 1:54 pm
Posts: 7090
Full Member
 

I think the comment on line 1 is a clue...


 
Posted : 08/01/2013 1:58 pm
Posts: 0
Free Member
 

I don't think that the file is a script because there is no #!/bin/ksh at the start of the file. I suspect that a shell script reads this file for data and that the : are delimiters.


 
Posted : 08/01/2013 3:23 pm
Posts: 2
Free Member
 

Is this the entire file?
Because if it is then as above r_dir must be somewhere else.
It could be an executable or it could be another script but that's the one doing the work.

from what you've provided anyway.


 
Posted : 08/01/2013 3:53 pm
Posts: 14
Free Member
 

Taking a guess - there's a script called r_dir - you could always use

find / -name r_dir
to see if that finds it
Continuing the guesswork, this script, run from the command line will ask you to confirm it's action (Y to confirm), which would be the Run parameter. No idea what the number is
Based on
# Remove the /apps/1/confg/s/sers directory

I'd hazard a guess that the script will delete the /apps/1/.. directory without asking for confirmation


 
Posted : 08/01/2013 4:24 pm
Posts: 0
Free Member
Topic starter
 

thanks everyone, as most of you suspected and i did too and found it, its a parameter file to hold parameters delimitered with : thats read by a KSH script somewhere else
ta for the help!!!


 
Posted : 09/01/2013 9:10 am