It’s very easy to iterate over lines of standard output of command.
Here is an example:
#!/bin/sh for i in `seq 0 5 15` do echo $i done
The output is:
0 5 10 15
seq 0 5 15 iterates from 0 to 15 with step 5
`command` executes command and return its standard output
one comment so far...
[...] 3rd field (in this case retrieve name of packages to delete) dpkg -P package purges package This link explains other things. It can be added to /etc/crontab as: 09 18 * * * root for i in `dpkg -l | [...]
leave a reply