The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Assign script parameters to variables giorgos193 Shell Programming and Scripting 16 04-14-2008 09:12 PM
help me in sending parameters from sqlplus script to unix shell script Hara Shell Programming and Scripting 2 01-29-2008 12:31 PM
Random parameters passing in FTP script sourabhshakya Shell Programming and Scripting 2 06-12-2006 08:20 AM
parameters from my program in c to a .ksh script DebianJ High Level Programming 2 05-16-2005 03:04 PM
Passing parameters in script eliguy UNIX for Dummies Questions & Answers 1 08-01-2001 10:13 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 11-14-2006
Registered User
 

Join Date: Sep 2005
Posts: 78
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
Reply With Quote
Forum Sponsor
  #2  
Old 11-14-2006
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
./yourscript admin

#!/bin/csh -f
#
cd /usr/$1
pwd
exit
Reply With Quote
  #3  
Old 11-14-2006
Registered User
 

Join Date: Jun 2004
Posts: 146
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0