Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


sh version | 24 comments | Create New Account
Click here to return to the 'sh version' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
sh version
Authored by: gatorparrots on Jul 20, '03 01:40:07AM
Here's an sh version (repeat after me: I will not script in tcsh, I will not script in tcsh...) that uses awk instead of sed:
#!/bin/sh
# returns percentage of maxvnodes used
vnodes=$(pstat -T |awk '/vnodes/ {print $1}')
maxvnodes=$(sysctl kern.maxvnodes | awk '{print $3}')
echo "$(expr $vnodes \* 100 / $maxvnodes)% used"


[ Reply to This | # ]