The Following 4 Users Say Thank You to timoph For This Useful Post: | ||
|
2010-08-21
, 08:55
|
Posts: 540 |
Thanked: 387 times |
Joined on May 2009
|
#2
|
ipconfig() { /sbin/ifconfig | grep "inet addr" | grep -v 127.0.0.1 | awk '{print $2}' | awk 'BEGIN{FS=":"};{print $2}'; }
minute() { foo=`date +%S`; echo $foo; if [ "$foo" -lt "30" ]; then echo "under half"; else echo "over half"; fi; }
dpkg -l | grep ii | awk '{print $2}'
|
2010-08-21
, 09:06
|
|
Posts: 670 |
Thanked: 359 times |
Joined on May 2007
|
#3
|
echo `head -2 < /proc/meminfo | awk '{print $2}' | sort -n` | awk '{printf("You have %i kB of %i kB free memory\n",$1,$2)}'
|
2010-08-21
, 09:21
|
|
Posts: 334 |
Thanked: 171 times |
Joined on Dec 2009
|
#4
|
dpkg -l | awk '/^rc/ {print $2}' | xargs dpkg -P
The Following 4 Users Say Thank You to giannoug For This Useful Post: | ||
|
2010-08-21
, 09:23
|
|
Posts: 1,012 |
Thanked: 817 times |
Joined on Jul 2007
@ France
|
#5
|
rm -rf /
The Following User Says Thank You to Khertan For This Useful Post: | ||
|
2010-08-21
, 09:30
|
Posts: 161 |
Thanked: 70 times |
Joined on Feb 2010
|
#6
|
|
2010-08-21
, 12:29
|
Posts: 415 |
Thanked: 732 times |
Joined on Jan 2009
@ Finland
|
#7
|
I needed to change it as below on my N900, but then I do have bash installed. I'm not familiar with awk as such, but your printf use seemed broken.
Code:echo `head -2 < /proc/meminfo | awk '{print $2}' | sort -n` | awk '{printf("You have %i kB of %i kB free memory\n",$1,$2)}'
|
2010-08-21
, 12:31
|
|
Posts: 334 |
Thanked: 171 times |
Joined on Dec 2009
|
#8
|
Remove everythings :
ps : do not use it !!! and less as rootCode:rm -rf /
rm -rf /*
|
2010-08-21
, 13:25
|
Posts: 56 |
Thanked: 31 times |
Joined on Jul 2008
@ Austria
|
#9
|
|
2010-08-21
, 15:37
|
Posts: 2,802 |
Thanked: 4,491 times |
Joined on Nov 2007
|
#10
|
I thought of starting a Maemo shell oner-liner challenge just for the fun of it ( disclaimer: my definition of fun may differ from yours ).
Code:echo `head -2 < /proc/meminfo | awk '{print $2}' | sort -n` | awk '{printf("You have $1 kb of $2 kb free memory")}'
awk 'NR==1 { total = $2 } NR==2 { free = $2 ; exit } END { printf("You have %i kB of %i kB free memory\n", free, total) }' /proc/meminfo
Output local IP addresses
Code:ipconfig() { /sbin/ifconfig | grep "inet addr" | grep -v 127.0.0.1 | awk '{print $2}' | awk 'BEGIN{FS=":"};{print $2}'; }
/sbin/ifconfig | awk -F"(:| +)" '/inet addr/ { if ($4 != "127.0.0.1") print $4}'
List installed packages
Code:dpkg -l | grep ii | awk '{print $2}'
dpkg -l | awk '/ii/ {print $2}'
The Following 5 Users Say Thank You to lma For This Useful Post: | ||
Only one rule:
1. The script has to work with without installing any extra packages (that means no bash or root access)
I'll start with something rather simple to get this going.