Topic: [SOLVED] pgrep won't work

Is my pgrep broken?
If I run

pgrep "firefox"

it just hangs and I have to use Ctrl+C to get back to the prompt, and bash reports "no such file or directory". It's the same with any other name I try: conky, gedit or whatever, with or without quotes. pkill seems to work OK, but I've not tried pgrep before.

which pgrep

gives /usr/bin/pgrep.

(I want to use it in a script to open a url in firefox if it's already up and running, or dillo if it's not.)

Last edited by johnraff (2010-03-12 16:29:20)

John
------------------------
( a boring Japan blog , and idle twitterings )
“There is more Unix-nature in one line of shell script than there is in ten thousand lines of C.” - Master Foo

Re: [SOLVED] pgrep won't work

What does `locate pgrep` give you?

while ( ! ( succeed = try() ) );

Re: [SOLVED] pgrep won't work

Jeeeezzz....  (what's the code for embarrassed-face-smiley?)
My humble apologies pvsage, and anyone else who might have wasted any of their time thinking about this.

I had a function in .bash_aliases called 'pgrep', so of course it was usurping the real thing.

Anyway, I suppose this could be an Awful Warning to anyone who puts home-brewed functions in .bash_aliases or executables in ~/bin to check first with 'which name' or something first. (In fact I put my ~/bin at the end of my $PATH, not the beginning, so it doesn't overload any legit apps, but that doesn't help with aliases of course.)

John
------------------------
( a boring Japan blog , and idle twitterings )
“There is more Unix-nature in one line of shell script than there is in ten thousand lines of C.” - Master Foo