LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-07-2003, 01:42 PM   #1
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
Bash's "present working directory" doesn't exit


I was trying (once again...) to get something done with my CD-RW writer, and in the process created a directory I didn't want, "/cdrom2" which I then deleted using rmdir.

Fine and dandy. The only thing is, somehow bash became convinced "cdrom2" was its present working directory, and every time I opened an xterm or su'd inside one, I would get a two-line error message about being unable to find the parent directory, the current working directory not existing, etc.

Finally I got tired of this (though it was just an annoyance and didn't hurt anything) and rebooted and now I'm back to "normal."

Question: Was there a way I could have convinced bash without rebooting to use another, existing, directory as its "present" working directory?

I searched here and on Google and could not find this problem!
 
Old 11-07-2003, 01:51 PM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
The process from which of all the commands you issued was in the
directory /cdrom2 when you deleted the directory, I'm
betting.

Almost every time you issue a command, it execs (creates another
process to run the command). This means the new command
can't find it's cwd. It inherits that from the parent. It had nothing
to inherit.

Next time, try:
cd <- puts you in your home directory
or
cd / <- puts you in root directory

then issue
rm -R -f /cdrom2 to delete the directory and it's contents and subdirectories
 
Old 11-07-2003, 01:58 PM   #3
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Original Poster
Rep: Reputation: 47
That may be what happened, though I thought I'd moved up a rung in the hierarchy to do my rmdir. Actually I thought it was impossible to remove a directory while you were still in it, but that could just be a remnant of my Windows days coming back to haunt me...

Next time, I'll be extra careful where I am when I use rmdir command! Thanks for the suggestion.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"bad interpreter : no such file or directory" when configure "flex" acer_peri Linux - Software 10 11-10-2010 01:19 AM
echo "blabla" in a script present present in /etc/rc.d/rc5.d/S96dinesh murugesan Linux - Newbie 3 04-14-2009 10:53 PM
wireless drivers installed, card on lspci, "hardware NOT present" colindownes Linux - Wireless Networking 1 12-21-2004 06:27 PM
audio not working.."device not present"?? abiagi Linux - Hardware 4 12-05-2003 10:41 PM
i just finished typing "./configure" and "make" in mplayer directory... kublador Linux - General 4 02-22-2003 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:47 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
Open Source Consulting | Domain Registration