need help w/ awk & printf
This very simple script works fine:
Code:
echo -n "Kernel:" Kernel:Linux 2.6.5 CPU:AMD Athlon(TM) XP 2200+ MHz : 1795.664 Mem/Use:1002320 188820 Uptime:5:41 I would however like to change the format so that it looks like this: Kernel:Linux 2.6.5 CPU:AMD Athlon(TM) XP 2200+ @ 1795.664 MHz Mem/Use:1002320 188820 Uptime:5:41 So far I have only managed to make the format extremely ugly. :( Thanks alot for any pointers! :) |
It works with backticks:
Code:
echo "Kernel: `uname -a|awk '{print $1, $3}'` CPU: `cat /proc/cpuinfo|grep name|awk '{print $4, $5, $6, $7}'` @ `cat /proc/cpuinfo|grep MHz|awk '{print $4" "$2}'`" Code:
echo -n "Kernel: `uname -a|awk '{print $1, $3}'`" |
Code:
#!/bin/bash |
:) Perfect! Thanks alot.
|
All times are GMT -5. The time now is 11:12 AM. |