[SlugBug] Using cut in bash scripts

Craig Andrews craig at simplyspiffing.com
Thu Apr 6 20:36:56 BST 2006


On Thu, Apr 06, 2006 at 08:14:35PM +0100, Neil McGovern wrote:
> Well, there's a few ways to tighten this up :)
> 
> Try simply:
> pidof icecast

Well, I have no idea how I spent this long not knowing this :-)

> Instead of cut in this example, I'd use
> awk '{print $2}'

The $1 was necessary because I'd got rid of the -u switch, thus making
the pid the first column. Of course, that's moot now!

Ta,

-- 
Craig Andrews <craig at simplyspiffing.com>



More information about the SlugBug mailing list