Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 03-12-2007, 02:22 AM   #1
LQ Newbie
Registered: Mar 2007
Posts: 1

Rep: Reputation: 0
puhsd, popd implementation

Hi Everyone!

I need to do my own implementation of the pushd and popd commands using a shell script. I'm trying to implement the directory stack using a text file. My current "mypushd" basically just copies the argument given by the user into a text file. However, say the user does

mypushd .

In this case, I want the current directory to be copied to the text file, not the character ".". Any suggestions on how to do this?

Thank you.
Old 03-12-2007, 07:37 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,845

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342
echo $PWD >> mytextfile

will append the present working directory (pwd) to the end of the text file.

echo $PWD > mytextfile will overwrite the file so that the only thing in the file will be the pwd.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sniffer implementation Al-xkon Programming 10 07-06-2006 06:45 AM
mmap implementation ash_lly Programming 4 03-10-2006 02:16 AM
Implementation for pthread.h lucky6969b Programming 3 02-22-2006 03:01 AM
read() implementation glalejos Programming 1 03-04-2005 07:00 AM
SSH implementation. sixth_sense Linux - Newbie 1 04-05-2004 12:13 PM

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

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