8 msgLooking into zip files
37 msgstar
2 msgNew mobo and USB problems
18 msghelp with the dreaded mount: RPC: Program not r...
2 msggcc 4.2.0 with java
23 msg{OT} Opinions on Host's Decision Please
3 msgpython-2.5
2 msgNo ogg sounds
1 msgAcidrip Pango-WARNING
3 msgskype and logitech quickcam communicate STX
9 msgdisable dropping to -j1 when building certain p...
4 msgcontinue emerge on failure
9 msgportage: error scanning <directory>/
5 msgMeaning of bold/regular font in output from emerge
4 msgglibc-2.3.6 fails to compile (in a vserver)

OT: Bash question
\ Anthony E. Caudel (20 Sep 2007)
. \ Dirk Heinrichs (20 Sep 2007)
. \ Frank Gruellich (20 Sep 2007)
. . \ Anthony E. Caudel (21 Sep 2007)

1 msgAudio/mp3 problems, something not set properly
2 msgBad 3Dness from my Intel 855GM!
13 msgStrange mplayer symbols on a terminal
1 msgPAE limitations
Subject:Re: OT: Bash question
Group:Gentoo-user
From:Anthony E. Caudel
Date:21 Sep 2007


 
Frank Gruellich wrote:
> * Anthony E. Caudel <tony.caudel> 20. Sep 07:
>
>> Is there any way to make "pushd" and "popd" (Bash built-ins) silent?
>> [snip] For example:
>>
>> OLD_VER=$(pushd /boot; ls kernel-* | sort | head -1; popd)
>> echo $OLD_VER
>> /boot ~ kernel-2.6.22-gentoo-r2 ~
>>
>
> For that exact example... why you bother at all? $( ) opens a subshell
> and cd's in subshells don't interact with parent shell so you could
> simply write:
>
> OLD_VER=$(cd /boot; ls kernel-* | sort | head -1)
>
> or
>
> OLD_VER=`cd /boot; ls kernel-* | sort | head -1`
>
> if you want to be more compatible. Or am I missing a point?
>
> HTH, kind regards,
> Frank.
>
Thanks, Frank. That is the best solution.

Tony

--
Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin

--
gentoo-user mailing list



© 2004-2008 readlist.com