1 |
Frank Gruellich wrote: |
2 |
> * Anthony E. Caudel <tony.caudel@×××××××××.net> 20. Sep 07: |
3 |
> |
4 |
>> Is there any way to make "pushd" and "popd" (Bash built-ins) silent? |
5 |
>> [snip] For example: |
6 |
>> |
7 |
>> OLD_VER=$(pushd /boot; ls kernel-* | sort | head -1; popd) |
8 |
>> echo $OLD_VER |
9 |
>> /boot ~ kernel-2.6.22-gentoo-r2 ~ |
10 |
>> |
11 |
> |
12 |
> For that exact example... why you bother at all? $( ) opens a subshell |
13 |
> and cd's in subshells don't interact with parent shell so you could |
14 |
> simply write: |
15 |
> |
16 |
> OLD_VER=$(cd /boot; ls kernel-* | sort | head -1) |
17 |
> |
18 |
> or |
19 |
> |
20 |
> OLD_VER=`cd /boot; ls kernel-* | sort | head -1` |
21 |
> |
22 |
> if you want to be more compatible. Or am I missing a point? |
23 |
> |
24 |
> HTH, kind regards, |
25 |
> Frank. |
26 |
> |
27 |
Thanks, Frank. That is the best solution. |
28 |
|
29 |
Tony |
30 |
|
31 |
-- |
32 |
Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. |
33 |
-- Benjamin Franklin |
34 |
|
35 |
-- |
36 |
gentoo-user@g.o mailing list |