how to send parameters to script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to send parameters to script
# 1  
Old 11-14-2006
how to send parameters to script

hi all
i have a script in c-shell call test
that i want to send to him parameter
name of directory to go to
something like this
the script :
cd /usr/(here i want that he will go to the name of the directory that i send to him as a parameter)
like :/usr/admin admin is the parameter
the problem is that the parameter always change
(admin,test) etc.
ho shell i write script like this ?
can someone help me ?
best regards
# 2  
Old 11-14-2006
./yourscript admin

#!/bin/csh -f
#
cd /usr/$1
pwd
exit
# 3  
Old 11-14-2006
Hi naamas03,

I wrote something for example:
Code:
#! /bin/csh

set DIR=$1

cd $ORACLE_HOME/$DIR
ls

The script is executed as the following:
Code:
./send_param.csh bin

I sent paramter to the script . In this case is the directory "bin".

Regards,
Nir
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to create runtime variables based on the number of parameters passed in the script

Hi All, I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them abc.sh ---------- export Numbr_Parms=$# export a=1 while do export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies

2. UNIX for Dummies Questions & Answers

Perl Script:how to find how many parameters are required to run the script

How to find how many parameters are required to run a Perl script? (1 Reply)
Discussion started by: Lakshman_Gupta
1 Replies

3. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

4. Shell Programming and Scripting

Script Send Mail by Parameters avec Attached file

Hi i have a script for show the information files. ls -l how do you for to place this result in a file of text and to send it attached for e-mail. The information of the mail must be in paramentros. for example e-mail to I must write the e-mail, the subject and the motive of the mail! ... (1 Reply)
Discussion started by: krlos07
1 Replies

5. Shell Programming and Scripting

want to pass parameters to awk script from shell script

Hello, I have this awk script that I want to execute by passing parameters through a shell script. I'm a little confused. This awk script removes duplicates from an input file. Ok, so I have a .sh file called rem_dups.sh #!/usr/bin/sh... (4 Replies)
Discussion started by: script_op2a
4 Replies

6. AIX

tuning network parameters : parameters not persist after reboot

Hello, On Aix 5.2, we changed the parameters tcp_keepinit, tcp_keepintvl and tcp_keepidle with the no command. tunrestore -R is present in inittab in the directory /etc/tunables we can clearly see the inclusion of parameters during reboot, including the file lastboot.log ... (0 Replies)
Discussion started by: dantares
0 Replies

7. Shell Programming and Scripting

Unix Shell Script to loop over Directory and send Filesname as parameters

Hi there I'm new to UNIX scripting; I’m stuck with the following I have an Oracle SQL script that takes three parameters 1- File Name 2- File Path 3- File creation date Under UNIX I have a folder where files will be placed frequently and I need to upload those files to Oracle, what I need... (3 Replies)
Discussion started by: windjashi
3 Replies

8. Shell Programming and Scripting

call a script from another script passing parameters

I want to call script2 from script1 passing parameters. I want to read the parameters list in script1, check the local directory (for example - lpath1|lpath2|lpath3|lpath4|lpath5|) for the existance of files and set the` lcount` to the number of files in this folder (`... (2 Replies)
Discussion started by: Lenora2009
2 Replies

9. Shell Programming and Scripting

help me in sending parameters from sqlplus script to unix shell script

Can anybody help me out in sending parameters from sql*plus script to unix shell script without using flat files.. Initially in a shell script i will call sql*plus and after getting some value from some tables, i want that variable value in unix shell script. How can i do this? Please tell me... (2 Replies)
Discussion started by: Hara
2 Replies

10. UNIX for Dummies Questions & Answers

Passing parameters in script

I have 2 scripts: script1 and script2 Script1 passes 4 parameters to script2 as follows #script1 code ... ... script2 $var1 $var2 $var3 $var4 Script2 uses the export command to know to expect these values #script2 export $1 $2 $3 $4 code ... ... The problem that I am having is... (1 Reply)
Discussion started by: eliguy
1 Replies
Login or Register to Ask a Question