- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script quries
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 01:47 PM
06-27-2005 01:47 PM
script quries
When I run a script, I got the following using ps -ef | grep <script>:
cis_opr 11610 1 0 08:35:30 ? 0:00 /bin/ksh ./<script>
Can the script be run so that ps -ef | grep <script> will get the following (ie without /bin/ksh>
cis_opr 11610 1 0 08:35:30 ? 0:00 ./ezproxy
Thanks in advance.
- Tags:
- PS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 02:18 PM
06-27-2005 02:18 PM
Re: script quries
for example,
ps -ef | grep <script>|awk '{print $1,$2,$3,$4,$5,$6,$7,$9}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 03:56 PM
06-27-2005 03:56 PM
Re: script quries
Are you running it like:
$ ksh ./scriptname
or do you have #!/usr/bin/ksh as the first line of the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 05:52 PM
06-27-2005 05:52 PM
Re: script quries
When the script was executed, it consists of the following:
#!/usr/bin/ksh
I cotook out the #!/usr/bin/ksh and ran:
#ksh ./<script>
The result of ps -ef | grep <script> is the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 07:48 PM
06-27-2005 07:48 PM
Re: script quries
Try:
chmod +x script (or chmod 744 if you only want the owner to be able to execute the script)
./script
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 08:32 PM
06-27-2005 08:32 PM
Re: script quries
That's why you have to use either of the 2 things: ksh or #/usr/bin/ksh
and this may be the reason why its showing in ps -ef.
Check what is your default shell, try changing it and then running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 09:01 PM
06-27-2005 09:01 PM
Re: script quries
It's true that if you run a script in the process table as cmd appears the interpreter (i.e. in your case /bin/ksh).
Because I haven't your process running I used a running Perl script of mine as an example for how such parsing could look like.
As you may recognise I stripped off the 2nd field from the right side which holds the interpreter.
I used Perl for parsing but you could as well use any combination of awk, grep, sed, cut, tr ...
$ UNIX95= ps -fC arschd|perl -anle 'if($.>1){$F[-2]=undef;print "@F" }'
saz 4288 1 0 Jun 26 ? 00:01 /usr/local/sbin/arschd
I have to admid, because with ps output you have varying fields, that it would be better to use Perl's pack() function for this purpose.
But I thought this would be too distracting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2005 01:52 AM
06-28-2005 01:52 AM
Re: script quries
Yes, make the script file it's self executable (chmod), but also make sure that the first line of the script is something similar to:
#!/bin/ksh
This will tell the OS that when you run the script directly (i.e. ./ezproxy), it will use the interpreter '/bin/ksh' to run it in.
Go #! magic ;)