View Single Post

  #1 (permalink)  
Old 04-17-2008, 09:56 PM
al001 al001 is offline
Junior Member
User
 
Join Date: Apr 2008
My distro: fedora 7
Posts: 2
Rep Power: 0
al001 is on a distinguished road
Default Interpreting ~ from user input

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
Now if the user enters ~/tmp I want to go to the tmp directory in the user's home directory. With the code above the scripts sees the ~ as part of the name. Anyone knows how to solve this.

Thanks

a
Reply With Quote