LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices

Reply
 
Search this Thread
Old 08-04-2012, 05:06 PM   #1
cajunchief
Member
 
Registered: Sep 2010
Posts: 119

Rep: Reputation: 0
Why is my cd command not working?


I am on an AIX computer ver 5.3.

I am trying to write a script and I get to the part where I want the script to cd to another directory. Why does this command not work?

#!/bin/bash
echo 'What directory are we in? '
pwd
echo 'What directory do you wish to check: ?'
read $DIRPATH
cd $DIRPATH
pwd #this command prints out the current directory that i am in not where the CD commmand should put me?

cajuchief
 
Old 08-04-2012, 06:35 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,394

Rep: Reputation: 588Reputation: 588Reputation: 588Reputation: 588Reputation: 588Reputation: 588
Quote:
Originally Posted by cajunchief View Post
read $DIRPATH
Leave out the "$" sign there. What is happening is that the shell is substituting the current value (NULL) of DIRPATH there and running the read command with no argument, and whatever you typed in gets assigned to the variable REPLY.
 
Old 08-04-2012, 08:34 PM   #3
cajunchief
Member
 
Registered: Sep 2010
Posts: 119

Original Poster
Rep: Reputation: 0
Thank you great help

THANK YOU FOR ALL YOUR HELP! IT WORKED !


SOLVED


cajunchief
 
Old 08-05-2012, 11:15 PM   #4
matrix57
LQ Newbie
 
Registered: Aug 2012
Posts: 1

Rep: Reputation: Disabled
I have just joined this thread.... I have found this topic really interesting.
 
  


Reply


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
ls command not working pallavibsh Linux - Server 6 05-14-2012 05:39 AM
[SOLVED] command line cd command not working right bjrn64 Linux - Software 6 05-10-2010 05:46 AM
ls command not working puneetbrar Linux - Newbie 4 05-23-2009 07:52 PM
./configure command isn't working in command line jumpmansbro Linux - Newbie 20 01-22-2009 08:29 PM
at command not working??? sulekha Ubuntu 2 07-27-2007 01:17 PM


All times are GMT -5. The time now is 06:07 PM.

Main Menu
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