Stop Bash from getting ahead of itself...
December 6, 2008 1:09 PM
Subscribe
Shell scripting quandry: running apt-get and then running a command that requires a apt-get installed package fails because bash doesn't wait for apt-get to finish...
My first approach is running a shell script that runs the installation, and I've had this problem. The code is like
apt-get install blah blah blah python-setuptools
easy_install libxml
However, bash runs apt-get and doesn't wait for it to finish before running the easy_install line - and the easy_install line requires setuptools to be installed. Currently I've just split the script into two scripts at that point, so that this little timing issue doesn't come up. But that's a workaround and I'm frustrated that there isn't a better way. Using 'wait' isn't working because apt-get is interactive...
Bonus points if you can point to a way that shell scripts can just install the most recent version of a package without specifying exactly what it is in the name? My issue is that this is for Ubuntu 7-8 and I don't want it to fail because of differences in repository versions...
Thanks! I'm a bit of a shell-scripting noob, and writing a robust install script for this project (Mapnik) is a big challenge.
posted by tmcw to computers & internet (4 comments total)
posted by holgate at 1:15 PM on December 6, 2008