Re: [gentoo-user] bash scripting tip

2010-11-12 Thread Bill Longman
On 11/12/2010 09:57 AM, Philip Webb wrote: There are quick'n'easy commands to goto the previous dir -- 'cd -' , which cb aliased as 'p' -- goto the next-higher dir -- 'cd ..' , which cb aliased as 's' -- , but is there a way to set up a qne command to goto a parallel dir, eg if you're in

Re: [gentoo-user] bash scripting tip

2010-11-12 Thread Philip Webb
101112 Bill Longman wrote: On 11/12/2010 09:57 AM, Philip Webb wrote: but is there a way to set up a command to goto a parallel dir, eg if you're in ~/tmp goto ~/hold ( 2 of my commonly-used dirs) ? The elegant way is 'function cd2() { cd .. ; cd $$1 ; }'. cd ${PWD/old/new} works when

Re: [gentoo-user] bash scripting tip

2010-11-12 Thread Hilco Wijbenga
On 12 November 2010 09:57, Philip Webb purs...@ca.inter.net wrote: It needs to be a Bash function, so in  ~/.bashrc I tried 'function cd2() { cd .. ; cd $1 ; }', Doesn't function cd2() { cd ../$1 } work? (I haven't tried it.)

Re: [gentoo-user] bash scripting tip

2010-11-12 Thread Hilco Wijbenga
On 12 November 2010 10:36, Hilco Wijbenga hilco.wijbe...@gmail.com wrote: On 12 November 2010 09:57, Philip Webb purs...@ca.inter.net wrote: It needs to be a Bash function, so in  ~/.bashrc I tried 'function cd2() { cd .. ; cd $1 ; }', Doesn't function cd2() { cd ../$1 } work? (I haven't

Re: [gentoo-user] bash scripting tip

2010-11-12 Thread BRM
- Original Message From: Hilco Wijbenga hilco.wijbe...@gmail.com On 12 November 2010 10:36, Hilco Wijbenga hilco.wijbe...@gmail.com wrote: On 12 November 2010 09:57, Philip Webb purs...@ca.inter.net wrote: It needs to be a Bash function, so in ~/.bashrc I tried 'function

Re: [gentoo-user] bash scripting tip

2010-11-12 Thread Philip Webb
101112 Hilco Wijbenga wrote: On 12 November 2010 09:57, Philip Webb purs...@ca.inter.net wrote: I tried 'function cd2() { cd .. ; cd $1 ; }', Doesn't 'function cd2() { cd ../$1 ; }' work ? -- Yes Yes, you're correct (slightly red face) ! I'm not sure why I didn't try that variation originally.