Modifying the cd command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Modifying the cd command
# 1  
Old 03-05-2011
Modifying the cd command

Hello everyone, I am currently doing a utility that acts like a cd command but keeps track of your change of directories.

What I plan to do is just to modify the cd source code, is that even possible? Can someone please help me with this?

I also need to incorporate the command with the history command.
# 2  
Old 03-05-2011
Not a hope in hell.

(Sorry to be so blunt but the "cd" command is built into most modern Shells and modifying this command woud take the level of expertise afforded by Kernighan and Ritchie).

If you have a real commercial problem, please state the problem.
# 3  
Old 03-05-2011
This has been done before. Do a web search for "pushd popd dirs"
This User Gave Thanks to fpmurphy For This Post:
# 4  
Old 03-06-2011
Quote:
Originally Posted by fpmurphy
This has been done before. Do a web search for "pushd popd dirs"
Thank you so much for that, but I am having a problem implementing it. Uhm is it a built-in command already?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modifying bash script to take each line in a file and execute command

I need to modify a bash script to to take each line in a file and execute command. I currently have this: #!/bin/bash if ; then echo "Lipsa IP"; exit; fi i=1 ip=$1 while ; do if ; then rand=`head -$i pass_file | tail -1` user=`echo $rand | awk '{print $1}'` pass=`echo $rand | awk '{print $2}'`... (3 Replies)
Discussion started by: galford
3 Replies

2. Shell Programming and Scripting

Modifying file from command line using Perl

Hi all, I am having a slight issue updating a file using perl from the command line I need some help with. The item is: DATA_FILE_TYPE=FULL When I run the below command /usr/bin/perl -p -i -e "s/DATA_FILE_TYPE=/DATA_FILE_TYPE=APPEND/g" processfile.cfg It looks to be... (2 Replies)
Discussion started by: kstevens67
2 Replies

3. Shell Programming and Scripting

Modifying the .bashrc

I have modified the .bashrc. The problem is that when I write a long command, it does not write on the next line but continues to write on the same line. # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for... (1 Reply)
Discussion started by: kristinu
1 Replies

4. Shell Programming and Scripting

Need some help modifying script

I have a script that currently runs fine and I need to add or || (or) condition to the if statement and I'm not sure the exact syntax as it relates to the use of brackets. my current script starts like this: errLog="/usr/local/website-logs/error.log" apacheRestart="service httpd restart"... (3 Replies)
Discussion started by: jjj0923
3 Replies

5. UNIX for Dummies Questions & Answers

Understanding / Modifying AWK command

Hey all, So I have an AWK command here awk '{if(FNR==NR) {arr++;next} if($0 in arr) { arr--; if (arr == 0) delete arr;next}{print $0 >"list2output.csv"}} END {for(i in arr){print i >"list1output.csv"}}' list1 list2 (refer to image for a more readable format) This code was submitted... (1 Reply)
Discussion started by: Aussiemick
1 Replies

6. Shell Programming and Scripting

modifying a row

I want to modify a file by deleting certain characters. The file looks like this: >ctg86 org=S_bayanus] moltype=genomictg] ctgontig=ctg86] RRRRRRRRRRRRRRRRRRRRRRRRRRRRTTTTTTTTTTTTTTTTTTTTTTTYYYYYYYYYYYYYYYYYYYYFFFFFFFFFFFGGGGGGGGGHHHHH >ctg86 org=S_bayanus] moltype=genomictg] ctgontig=ctg86]... (4 Replies)
Discussion started by: phil_heath
4 Replies

7. UNIX for Dummies Questions & Answers

After modifying .cshrc file, ls: Command not found

I am using Redhat 4.1.2, tcsh shell To add a program to my path, I added the following line to my .cshrc file: set path = (/home/R/R-2.11.0/bin/ /home/R/R-2.11.0/library) It worked, I am able to run the program I wanted. But the pathway above overwrote all other existing paths - so I can no... (1 Reply)
Discussion started by: Euphoria
1 Replies

8. Shell Programming and Scripting

Modifying command for Tar.gz Files.

:) Hi, I use the following command to search for a string in all the files in the directories and sub directories. find . -type f -print | xargs grep bermun@cial.net Can someone please cite a method wherin I can find the entries from a list of 300-500 *.gz files by modifying the above... (2 Replies)
Discussion started by: openspark
2 Replies

9. Shell Programming and Scripting

Need help in modifying the prompt

Hi, I want to change the login prompt from $ to something more explanatory like (Username)(basename of pwd): I also need to get this in a different font color. Can someone pls tell me what I have to modify in my rc file. I m using CShell currently. Would be great if u can give me... (7 Replies)
Discussion started by: mahatma
7 Replies

10. Shell Programming and Scripting

modifying my shell

Hello, I have installed a new program called chimera under the directory /usr/local/bin/chimera. the executable is under the directory /usr/local/bin/chimera/bin/chimera.e If i put myself under the latest directiry and I type ./chimera, the program works. I would like to avoid this and I... (1 Reply)
Discussion started by: nico-hellas
1 Replies
Login or Register to Ask a Question