saving ksh parms

saving ksh parms

Post by Michael » Sat, 19 Feb 2005 06:32:32



Hi,

what is the correct way of saving parameters of a ksh script to a file
or passing it to another script?

for example if t1.ksh and t2.ksh both use 5 parms and t2.ksh needs to
retrive saved parms from a file.

this is what I did :

t1.ksh:

cat  > tmpfile.log <<eot
"$1""$2""$3""$4""$5"
eot

and t2.ksh:
cat tmpfile.log | read x

set - $x
echo total $#

thanks
Michael

 
 
 

saving ksh parms

Post by Bill Marcu » Sat, 19 Feb 2005 17:07:00


On 17 Feb 2005 13:32:32 -0800, Michael A

> Hi,

> what is the correct way of saving parameters of a ksh script to a file
> or passing it to another script?

> for example if t1.ksh and t2.ksh both use 5 parms and t2.ksh needs to
> retrive saved parms from a file.

> this is what I did :

> t1.ksh:

> cat  > tmpfile.log <<eot
> "$1""$2""$3""$4""$5"
> eot

What if one of those parameters contains a space?  Why not pass them
as parameters?



 
 
 

saving ksh parms

Post by Michael » Sun, 20 Feb 2005 03:07:21


hi,

I need to save the parms in a file to be used later.
if t1 was invoked by :  t1.ksh 1 2 3 4 "5 x xxx xxxx "
t2.ksh needs to read the above parms from a file and process exactly 5
parms.

thanks
Michael

 
 
 

saving ksh parms

Post by Kevin Rodger » Sun, 20 Feb 2005 07:55:14



> I need to save the parms in a file to be used later.
> if t1 was invoked by :  t1.ksh 1 2 3 4 "5 x xxx xxxx "
> t2.ksh needs to read the above parms from a file and process exactly 5
> parms.

In t1.ksh:

In t2.ksh:
IFS= read -r arg1 arg2 arg3 arg4 arg5 < t1.args

--
Kevin Rodgers

 
 
 

1. Passing parameter to PARM file of sqlloader dynamically from .ksh file

Hello there.

i am loading flat file(s) in ORACLE Table from unix using sqlldr
command.
to do so i use following command through a .ksh script (current file)
:

sqlldr parfile=abc.parm

where abc.parm is the parameter file having all the needed parameters
set.

Here in this parameter file i need to have the path of different
directories having source flat file names passed to be loaded to the
[data parameter] parm file dynamically, depending on the values
returned for those flat file path from previous .ksh script (parent
file)

i.e. parent .ksh calling current .ksh and from current .ksh sqlldr
fires.

How to export variables of parent script to current scripts child ?

How can one hide the command being displayed in the ps ?

any thoughts , suggestions ?

Thanks,
ms

2. Netork Monitoring

3. Passing parms from prompt to .ksh file to SAS program-how?

4. LILO problem?

5. ksh: if I trap on exit to rm tmp files, how do I save return value ?

6. SETUP HELP

7. save ksh history files ?

8. How to save $@ in sh/ksh

9. how linus saved (is saving my finals)

10. "Quit and save - Exit and don't save" why?

11. "Save Desktop to new.xinitrc" won't save...

12. KDE Session save: no save as default