Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
how to use 'cd' command in shell sc
Name: Prashanth M.N. Date: March 12, 2003 at 23:52:36 Pacific OS: linux 7.1 CPU/Ram: p3, 128mb
Comment:
how to make the command 'cd' work in shell script to change directory?
Name: 3Dave Date: March 13, 2003 at 01:27:03 Pacific
Reply:
What isn't working about it? You may find it helpful to enclose the path in quotes or use the \ escape character if you have any spaces in the name, eg: #!/bin/bash cd /home/foo/my\ folder
0
Response Number 2
Name: Don Arnett Date: March 13, 2003 at 13:08:48 Pacific
Reply:
The 'cd' command works just as normal inside a shell script. The thing that is probably throwing you off is that when the script finishes, you are in the same directory as where you started. That is normal.
When you call a shell script, I believe that you are starting another shell, so using 'cd' in the new shell doesn't effect (affect??) the current directory in the calling shell.
To show yourself that it is changing directories, put these lines in a script and execute it:
echo $PWD cd someNewDirectory echo $PWD
0
Response Number 3
Name: prashanth Date: March 14, 2003 at 18:48:14 Pacific
Summary: Security transferred our KORN shell scripts from our server running Linux to another server running NT so they could run a virus scan program against them. Then they copied our scripts back and none ...
Summary: Could someone told me how to use RPM (Redhat Package Management) in the enviroment of Windows? I have known there is a command called rpm can unpack or install a package,but does it act like a DOS ext...