LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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
 
LinkBack Search this Thread
Old 03-12-2007, 01:22 AM   #1
Rudess
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, 06:37 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,695

Rep: Reputation: 286Reputation: 286Reputation: 286
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.
 
  


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 04:08 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