This is a discussion on Interpreting ~ from user input within the Shell scripting forums, part of the Development/Scripting category; Hi, I'm writing a script where the user can enter a directory name. For instance Code: #!/bin/sh echo Where do ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
Hi,
I'm writing a script where the user can enter a directory name. For instance Code:
#!/bin/sh echo Where do you want to install the package? [$INSTALL_DIR] read new_install_dir cd $new_install_dir Thanks a |
| Sponsored Links | ||
|
|
|
||||
|
Add eval before cd
Code:
#!/bin/sh echo Where do you want to install the package? [$INSTALL_DIR] read new_install_dir eval "cd $new_install_dir" echo "You are in $(pwd) directory" HTH
__________________
Rocky Jr. You may have my body & soul, but you will never touch my pride! If you have knowledge, let others light their candles at it. Certified to work on HP-UX / Sun Solaris / RedHat |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Add normal user / FTP user usein NORMAL user(non-root) | anilvrathod | Shell scripting | 0 | 12-07-2007 06:04 PM |
| how to enable a user and disabling a user | narasimha.reddygnv | Shell scripting | 1 | 03-31-2007 12:31 AM |
| Shell script to supply or input a password passphrase | kasimani | Shell scripting | 1 | 02-21-2007 09:21 AM |
| curses Problems with Non-Blocking input | kgmf | Coding in General | 3 | 04-01-2005 01:49 PM |
| Program gets aborted on large input | Ssk | Linux software | 7 | 03-14-2005 11:04 AM |