[Solved] Howto change subdirectory easily using cd


 
Thread Tools Search this Thread
Operating Systems HP-UX [Solved] Howto change subdirectory easily using cd
# 1  
Old 01-08-2010
[Solved] Howto change subdirectory easily using cd

Hi all,

how to change the path easily from
Code:
/u01/oracle/oradata/newdb/tab >cd olddb
/u01/oracle/oradata/olddb/tab >

or
Code:
/u01/oracle/oradata/newdb/tab >cd u05
/u05/oracle/oradata/newdb/tab >

I am lazy for typing the abs. path again...
As I know there is some "tips" in doing this.

Thanks in advance

Last edited by vbe; 06-14-2010 at 12:33 PM..
# 2  
Old 01-08-2010
Hi, I guess this isn't water proof, but You could try something like this, using shell substitution (in bash not sure about ksh or others),

Code:
cd ${PWD/newdb/olddb}
cd ${PWD/u01/u05}

but as You can see, is could easily happen that strings match in more than one place...



Best regards,
Lakris
# 3  
Old 01-08-2010
Quote:
Originally Posted by thegeek
lazy people seem to be smarter, as they use a lot of brain energy on finding an easier way to do stuff. -- from a web page...



Yes the tip is use CDPATH, refer: 6 Awesome Linux cd command Hacks – Productivity Tip#3 for Geeks
It's great!

Many thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Howto remove extra space in the file

Hi Gurus, I have a file which contains some special char or space. when using cat -evt I can see the file as following: 0,"0000","abc/def aaa ... (6 Replies)
Discussion started by: ken6503
6 Replies

2. HP-UX

[Solved] Unable to change/create home dir for particular user

Hi all I wanted to change the home dir for a user, but when using smh : SMH->Accounts for Users and Groups->Local Users->Modify User ---------------------------------------------------------------------------------------------------------------------------------------------- * Required... (8 Replies)
Discussion started by: fretagi
8 Replies

3. UNIX for Advanced & Expert Users

Change value of a parameter in a file[solved]

I have a requirement to change the value of a parameter in a configuration file at a certain time before a particular script (python script) runs so that it outputs debug logs for the script. There are lots of other parameters in the file but i wnat to change only this particular parameter. ... (0 Replies)
Discussion started by: GosarJunk
0 Replies

4. Solaris

[Solved] How to change my default login mode????

Hi guys, I have just installed Solaris 10 x86. My system boots into graphical login by default, I want to have text login only, where can I change that. I tried to use the linux and bsd concept of editing /etc/inittab, and change the default value to 3, but that doesn't work in Solaris. Please... (6 Replies)
Discussion started by: gabam
6 Replies

5. Solaris

Putty : Change default settings (solved)

Hi, I use to work on solaris via putty and always on session start - i use to increase the font to 14 bold - capture session output to a file my requirement) to make these changes permanent, so that i need not to change the settings everytime i connect via putty please advice. ... (0 Replies)
Discussion started by: saurabh84g
0 Replies

6. Shell Programming and Scripting

[Solved] Change Upper case to Lower case in C shell

Is there a command that can switch a character variable from UPPER case to lower case? like foreach AC ( ABC BCD PLL QIO) set ac `COMMAND($AC)` ... end Thanks a lot! (3 Replies)
Discussion started by: rockytodd
3 Replies

7. Shell Programming and Scripting

howto change format of file?

Hi I have a file with this inside: How can I change it to: thanks a lot regards Israel. (3 Replies)
Discussion started by: iga3725
3 Replies

8. Shell Programming and Scripting

HOWTO - change letter case of variable value

Hi I have e.g. VAR1=january and I need to change it into VAR1=January. How to change value of VAR1 variable to always set first character uppercase and other lowercase ? thx for help. (9 Replies)
Discussion started by: presul
9 Replies

9. UNIX for Dummies Questions & Answers

howto change parameter in vi to take tmp file

i have a problem running vi. there is no space in /var where it creates tmp file. How can I change this parameter so that it takes from other directory. thanks (4 Replies)
Discussion started by: ajaya
4 Replies

10. UNIX for Advanced & Expert Users

Change password script in Unix easily..

I have more than 50 server unix's password need to change, usually I assign one password for all hosts, for easy remember, but I need to change password every two months..it's very tried to change password every 2 months, is there any unix script that can change password easily? ie ' script... (4 Replies)
Discussion started by: zp523444
4 Replies
Login or Register to Ask a Question