Gentoo Archives: gentoo-user

From: "Anthony E. Caudel" <tony.caudel@×××××××××.net>
To: Gentoo Mailing List <gentoo-user@l.g.o>
Subject: [gentoo-user] OT: Bash question
Date: Thu, 20 Sep 2007 09:10:40
Message-Id: 46F23395.7030305@sbcglobal.net
1 Is there any way to make "pushd" and "popd" (Bash built-ins) silent? As
2 it is, when the execute, the directory is echoed to the output, making
3 it difficult to use the commands in a script. For example:
4
5 OLD_VER=$(pushd /boot; ls kernel-* | sort | head -1; popd)
6 echo $OLD_VER
7 /boot ~ kernel-2.6.22-gentoo-r2 ~
8
9 The /boot and the tildes are returned by pushd and popd and mess up the
10 script.
11
12 There doesn't seem to be any options to turn off the echo off and shopt
13 has nothing in it.
14
15 Tony
16
17 --
18 Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety.
19 -- Benjamin Franklin
20
21 --
22 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] OT: Bash question Dirk Heinrichs <dirk.heinrichs.ext@×××.com>
Re: [gentoo-user] OT: Bash question Frank Gruellich <frank@×××××××××.org>