![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Absolute Beginner Talk The perfect starting place to find out more about computers, Linux and Ubuntu. |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Ubuntu addict and loving it
![]() Join Date: Jun 2007
Location: Maryland, US
Beans: 3,564
Ubuntu 9.10 Karmic Koala
|
pushd and popd commands
Does anybody know which package provides the 'pushd' and 'popd' shell commands?
Is there any option available with apt-get that allows for me to determine this? With yum (which is a Red Hat and Fedora tool similar to apt-get), there is such a feature. With apt-get, I can't tell. |
|
|
|
|
|
#2 |
|
Fresh Brewed Ubuntu
![]() Join Date: Apr 2007
Location: Redmond, WA
Beans: 1,371
Ubuntu 8.04 Hardy Heron
|
Re: pushd and popd commands
With apt you use apt-cache search to find packages and to learn more apt-cache show to get the details of the package. I think ipopd is the package you are looking for.
__________________
|
|
|
|
|
|
#3 |
|
Skinny Extra Sweet Ubuntu
![]() Join Date: Apr 2005
Location: Finland
My beans are hidden!
Hardy Heron (Ubuntu Development)
|
Re: pushd and popd commands
Those are built-in commands in bash. I don't think there's a way to find this out using apt-tools, as those are not separate binaries in your system and for instance apropos doesn't know about those.
|
|
|
|
|
|
#4 | |
|
Ubuntu addict and loving it
![]() Join Date: Jun 2007
Location: Maryland, US
Beans: 3,564
Ubuntu 9.10 Karmic Koala
|
Re: pushd and popd commands
Quote:
Anyhow, thanks. |
|
|
|
|
|
|
#5 |
|
Fresh Brewed Ubuntu
![]() Join Date: Jun 2007
Location: Greater Boston
Beans: 1,538
Ubuntu 9.10 Karmic Koala
|
Re: pushd and popd commands
I have a shell script that came over from RedHat. I have read some posts indicating that I needed to change #!/bin/sh to #!/bin/bash. I did but my shell script still does not recognize pushd and popd.
What am I doing wrong? Edit 11/05/07 I am supposed to install bash-builtins. I have, and will comment back here, if this solves my problem. This is what the error looks like: /home/ics/ics_util/DBImport: 202: pushd: not found /home/ics/ics_util/DBImport: 209: popd: not found
__________________
cmn Last edited by cmnorton; November 5th, 2007 at 11:22 AM.. Reason: Additional Information Found |
|
|
|
|
|
#6 |
|
Ubuntu addict and loving it
![]() Join Date: Jun 2007
Location: Maryland, US
Beans: 3,564
Ubuntu 9.10 Karmic Koala
|
Re: pushd and popd commands
First verify if you have bash installed on your system. Run these commands:
Code:
$ ls -l /bin/bash $ ls -l /bin/sh If you do not have bash, get it using the apt-get command or synaptic. If you are like me, and annoyed that Canonical decided to do something crude/different for the /bin/sh, blow away the link and set it to point to bash. This will obviate the need to edit scripts you may obtain from the third parties. Here's how you do that: Code:
$ sudo rm -f /bin/sh $ sudo ln -s /bin/bash /bin/sh |
|
|
|
|
|
#7 | |
|
5 Cups of Ubuntu
![]() |
Re: pushd and popd commands
Quote:
Thanks dwhitney67 Saeed |
|
|
|
|
|
|
#8 | |
|
Fresh Brewed Ubuntu
![]() Join Date: Oct 2007
Location: ISS
Beans: 1,429
|
Re: pushd and popd commands
Quote:
But AFAIK you can use bash even if your /bin/sh links to dash. First make sure that your script starts with #!/bin/bash and it is executable. Now there is a difference between calling your script with Code:
sh script Code:
./script So to start your script with bash make sure that 1) It starts with #!/bin/bash 2) It is executable 3) You call it by name rather than "sh script". |
|
|
|
|
|
|
#9 |
|
Ubuntu addict and loving it
![]() Join Date: Jun 2007
Location: Maryland, US
Beans: 3,564
Ubuntu 9.10 Karmic Koala
|
Re: pushd and popd commands
There are many 3rd-party scripts that begin with the "#!/bin/sh". Do you suggest I edit each one I encounter so that it has "#!/bin/bash"?
I know, I realize that this is not an everyday problem, but still it is annoying to troubleshoot an error when a script works flawlessly on one *nix system, but not on Ubuntu. With dash, and I believe this is how this thread got started, the commands 'pushd' and 'popd' are not available. Similarly, a simple command like the following is also doesn't work: Code:
$ cp myfile{,.bak}
|
|
|
|
|
|
#10 |
|
Fresh Brewed Ubuntu
![]() Join Date: Oct 2007
Location: ISS
Beans: 1,429
|
Re: pushd and popd commands
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|