LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bash script error (http://www.linuxquestions.org/questions/linux-newbie-8/bash-script-error-939800/)

tuts73 04-14-2012 12:13 PM

bash script error
 
hi all... im a newbie to all this. i need help with a simple script. i have to change to one directoy then to another but i get an error cd: /~ no such file or directory

Can you help plz..ty


#!/bin/bash

cd /tmp
cd /~

uhelp 04-14-2012 12:27 PM

First this is wrong.
Usually there is no userhome under /
should read
Code:

cd ~
But this does not work on all *nixes.
Use instead
Code:

cd $HOME

tuts73 04-14-2012 12:31 PM

ahhh what an A-hole i am .... thank you


All times are GMT -5. The time now is 02:37 AM.