The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
running script in cron - with ssh commands - not working frustrated1 Shell Programming and Scripting 31 09-16-2008 10:14 AM
Shell script is not working... vishalpatel03 Shell Programming and Scripting 2 01-10-2008 05:19 PM
shell script to run a few commands help! perk_bud Shell Programming and Scripting 23 07-06-2007 03:34 AM
how to sql commands in shell script balireddy_77 Shell Programming and Scripting 1 11-15-2006 02:00 PM
How to run unix commands in a new shell inside a shell script? hkapil Shell Programming and Scripting 2 01-04-2006 06:56 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-04-2007
perk_bud perk_bud is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 23
pwd & cd commands not working in shell script

Here is my script

#!/bin/bash
pwd
cd /var/lib/pgsql

Both "pwd" and "cd" are not executed is there any other way i can change the current working directory to /var/lib/pgsql pls help!
  #2 (permalink)  
Old 07-04-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Quote:
Originally Posted by perk_bud View Post
Here is my script

#!/bin/bash
pwd
cd /var/lib/pgsql

Both "pwd" and "cd" are not executed is there any other way i can change the current working directory to /var/lib/pgsql pls help!
Do you want to change current working directory by running this script? Then run your script as follows
Code:
. script_name
Note the space between dot and script_name
  #3 (permalink)  
Old 07-04-2007
perk_bud perk_bud is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 23
I want to display the result of the current working directory in the script how do i do it
  #4 (permalink)  
Old 07-04-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Quote:
Originally Posted by perk_bud View Post
I want to display the result of the current working directory in the script how do i do it
Can you explain this? I dont get you.
  #5 (permalink)  
Old 07-04-2007
perk_bud perk_bud is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 23
I want to use the follwing command

pwd in the script but it says command not found after executing
  #6 (permalink)  
Old 07-04-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Quote:
Originally Posted by perk_bud View Post
I want to use the follwing command

pwd in the script but it says command not found after executing
Can you show the exact error message you are getting?
  #7 (permalink)  
Old 04-07-2008
ravikumarkakde ravikumarkakde is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 2
Thumbs up Hi !

Hi i have newly joined this forum .

Last edited by ravikumarkakde; 04-07-2008 at 07:08 AM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0