Re: howto serialize tasks in .xsession
On Sun, Feb 29, 2004 at 02:09:17AM -0500, Gregory Seidman wrote:
> ... A better
> way is to use a spinlock wrapped around lsof or netstat right after the
> gnome-settings-daemon call (note that calling it without any arguments
> works at least as well):
>
> #...
> gnome-settings-daemon &
> GSDPID=$!
> while lsof -u$USER | awk 'BEGIN { found = 0; }
> ($2 == "'$GSDPID'") && ($8 ~ /orbit-'$USER'/) { found = 1; next }
> END { exit found }'
> do
> sleep 1
> done
> sleep 1
> #...
>
This works. Thanks!
I'll grok it later.
I never really understood awk (still don't); it's nice to have a useful
example.
Reply to: