LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 04-14-2012, 01:13 PM   #1
tuts73
LQ Newbie
 
Registered: Apr 2012
Posts: 7

Rep: Reputation: Disabled
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 /~
 
Old 04-14-2012, 01:27 PM   #2
uhelp
Member
 
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
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
 
1 members found this post helpful.
Old 04-14-2012, 01:31 PM   #3
tuts73
LQ Newbie
 
Registered: Apr 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
ahhh what an A-hole i am .... thank you
 
  


Reply

Tags
bash scripting


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script read error and awk ouptut error whited Programming 4 10-16-2007 08:05 PM
bash script error noir911 Programming 4 09-27-2006 08:52 AM
bash script error noir911 Programming 5 09-12-2006 07:42 AM
error when tying to run python script(bash error?) shanenin Programming 5 01-10-2006 11:01 AM
bash script error corbis_demon Linux - Newbie 7 09-27-2004 11:41 AM


All times are GMT -5. The time now is 03:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration