converting .swf to .mpg
tommy.trussell at gmail.com
Wed May 14 15:37:13 UTC 2008
On 5/14/08, Patton Echols <p.echols at comcast.net> wrote:
> I found in /etc/cron.daily a script titled "dlocate" with the following
> #! /bin/sh
> # exit if dlocate is uninstalled but not purged
> test -x /usr/sbin/update-dlocatedb || exit 0
> # update dlocate database
> /usr/sbin/update-dlocatedb >/dev/null
> # update 'dlocate -l' emulation
> LINES=40 COLUMNS=200 dpkg -l "*" | sed -e '1,5d' -e 's/ */ /g' >$DPKGLIST
> not sure it makes sense to me why it calls for writing update-dlocatedb
> to /dev/null
> seems pointless, but then I don't know what the last line does either.
The script is sending any output from running the command to /dev/null
(also known as the "bit bucket" or in other words "nowhere").
Presumably whatever prints on the terminal when you run that command
is not useful in any way when run as a cron job. If it was, you could
capture it in a log somewhere.
The last line is creating the file at DPKGGLIST, which in the
beginning of the script you set to /var/lib/dlocate/dpkg-list -- so
it's that last line that creates the file you look at. (sed is a
"streaming editor" that rearranges the text based on the arguments. So
it's taking the output of "dpkg -l" and formatting it for you.
More information about the ubuntu-users