[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dependencies



On Tue, Apr 20, 1999 at 10:00:58AM -0500, Brian Servis wrote:
> #!/bin/sh
> # findlibpkg:  Find the libs that a executable depends on and what 
> #              package they are in.
> #
> # usage:   findlibpkg <full path of executable>
> 
> LIST=`ldd $1 | cut -d" " -f3`
> for i in $LIST ; do
>     zgrep "`echo $i | sed -e 's/^\///'` " /var/lib/dpkg/Contents.gz
> done
> 
> #end findlibpkg

<nitpick mode>

Every time I see sed expressions like that I shake my head.

The sed info page says:

`s/REGEXP/REPLACEMENT/FLAGS'
     (The `/' characters may be uniformly replaced by any other single
     character within any given `s' command.)

If your pattern and/or replacement space includes forward slashes, just use
another character.

Also, if you are passing a single sed command, you don't need "-e".

   If no `-e', `-f', `--expression', or `--file' options are given on
the command-line, then the first non-option argument on the command
line is taken to be the SCRIPT to be executed.

</nitpick mode>

As far as I know, these two facts have been true about sed since way back,
in the misty days before GNU sed.

-- 
G. Branden Robinson              |       "To be is to do"   -- Plato
Debian GNU/Linux                 |       "To do is to be"   -- Aristotle
branden@ecn.purdue.edu           |       "Do be do be do"   -- Sinatra
cartoon.ecn.purdue.edu/~branden/ |

Attachment: pgp5WuEAIE11D.pgp
Description: PGP signature


Reply to: