From: Paul Brannan Date: 2001-12-04T04:42:58+09:00 Subject: [ruby-talk:27366] Re: Programname in (un*x) top On Tue, Dec 04, 2001 at 03:07:10AM +0900, Yukihiro Matsumoto wrote: > Hi, > > In message "[ruby-talk:27344] Programname in (un*x) top" > on 01/12/03, SKa writes: > > |I know about the variable $0 and changing this leads to another > |program name in 'ps' but not in 'top'. > > Neither does Perl. Does anyone know whether it's possible? > > matz. I'm not sure if it's possible or not, but there are some alternatives: 1) Dunno if this works with a non-GNU top, but you can press 'c' to switch between different showing the command name and the command-line. If you wish, you can save your options with 'W'. 2) Try the following script: #!/bin/sh rm -f $1 ln -s `which ruby` $1 echo ./$* ./$* rm -f $1 Invoke it with: ./run_as.sh foo foo.rb And you will see "foo" in place of "ruby" in top. It's probably possible to make this a bit more transparent. Paul