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
shell script command lg123 UNIX and Linux Applications 3 04-11-2008 12:35 AM
Use ftp command in shell script infyanurag Shell Programming and Scripting 3 02-05-2008 04:06 AM
cd command is not working in my shell script amitrajvarma Shell Programming and Scripting 3 10-03-2007 02:04 AM
vi command in shell script bryan UNIX for Dummies Questions & Answers 2 05-23-2006 04:51 PM
Shell script command dipanrc Shell Programming and Scripting 7 11-29-2005 07:15 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-09-2007
Registered User
 

Join Date: Mar 2007
Posts: 37
how to use cd command in shell script

hi
buddies

i am not getting this

when am using the cd command it is not working
for example

makefile.ksh
---------------
#!/bin/ksh
dirpath=$1
cd dirpath

my intension is to give the directory path as a parameter at runtime, so i have done like this but the path which i required is not getting.

plz help in this

with regards
narayana
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-09-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
ignore this

Last edited by porter; 09-09-2007 at 03:05 AM.
Reply With Quote
  #3 (permalink)  
Old 09-09-2007
Registered User
 

Join Date: Mar 2007
Posts: 37
how to use cd command in shell script

i didn't get u
can u explain in detail
Reply With Quote
  #4 (permalink)  
Old 09-09-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by LAKSHMI NARAYAN View Post
#!/bin/ksh
dirpath=$1
cd dirpath
In your case, however you just need

Code:
#!/bin/ksh
dirpath=$1
cd $dirpath
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:36 AM.


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

Content Relevant URLs by vBSEO 3.2.0