Home
 
 
Search:  
C C++ Perl PHP Python HTML ShellScripts
 
 
  Coding Books
  Tutorials
  Search Code
  Browse Code
  Link to Us
  Site News
  Contact Metalshell
 
 
 
  Submit Code   Statistics
 



Learning Perl    (ISBN: 0596001320)


 

 List Price:
 Our Price:
 Used Price: $17.00

 Release Date: 27 July, 2001
 Manufacturer: O'Reilly UK (Paperback)
 Sales Rank: 1,013

 Author: Randal L. Schwartz, Tom Phoenix









More Info

 Runtime Info 2001-11-11 01:57:41
  perl 
Category: source:perl:runtime
Description: Displays some runtime information like the PID and the current priority level.
Platform: unix
Author: detour
Viewed: 1676
Rating: 4/5 (1 votes)
If you have any questions about this piece of code or still need help, try posting your question on the forum.

 

Printable Version
runtime_info.pl
#!/usr/bin/perl
#
# Runtime Info written by detour@metalshell.com
#
# Displays the PID, UID, GID, EUID, EGID, and the runtime priority
#
# http://www.metalshell.com
#



print "\nDisplay Runtime Info for $0\n";
print "----------------------------------\n";
print "PID           # ( $$ )\n";
print "REAL UID      # ( $< )\n";
print "EFFECTIVE UID # ( $> )\n";
print "REAL GID      # ( $( )\n";
print "EFFECTIVE GID # ( $) )\n";

# getpriority(WHICH, WHO)
#
# WHICH = 0, 1 or 2 for process priority, process group, and user priority.
# WHO = 0 for current user
#
# getpriority may not work on all systems.
#

$priority = getpriority(0,0);

print "Priority      # ( $priority )\n\n";
Rate this code:
(Not Helpful)  (Very Helpful) 

 
 
   Developer.*  
   Blue Parrots  
   Technipal  
   Defy Magazine  
   Code Project  
   Prog. Heaven  


Got Money?