![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Change Directory | vskr72 | UNIX for Dummies Questions & Answers | 2 | 05-26-2008 03:50 AM |
| Change directory in a shell script | laxmi | Linux | 12 | 01-17-2008 08:07 AM |
| change directory using shell script | laxmi | Shell Programming and Scripting | 0 | 01-17-2008 07:12 AM |
| Change Directory via a script? | George Borrmann | Shell Programming and Scripting | 3 | 10-09-2006 09:13 PM |
| change directory | mkan | Shell Programming and Scripting | 2 | 02-26-2005 04:55 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Change of directory thru script
Hi All, This script is not working. I want to change the directory as per users selection in current shell. Looks like it is spawning sub-shell internally. I have used . changedir.sh source changedir.sh ./changedire.sh But did not work. Currently shell directory remain the same. Please correct my mistakes. Thanks, Ram ************************* x=0 for tree in $( ls -l | grep "^d" | cut -c61- ) do x=`expr $x + 1` echo "$x $tree" done echo "Enter the view number to set or 0 to another view or q to quit" read answer y=0 for user in $( ls -l | grep "^d" | cut -c61- ) do y=`expr $y + 1` if [ $y == $answer ]; then cd $user echo "setting tree: $user" fi done *************************** |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|