Search Results

Search: Posts Made By: megacoder
20,515
Posted By megacoder
Fill'er up
Here's how to get /tmp 85% full; change the value if you like:$ amt=$(df --total /tmp | awk '/^total/ { printf "%d\n", (($2 * 1024) * 0.85); exit}')
$ dd if=/dev/zero of=/tmp/filler bs=${amt} count=1
22,886
Posted By megacoder
Gently
Seems reasonable to me, but I'd do this:
exec("comand && (sleep 3 ; kill -TERM $!; sleep 1; kill -9 $!)");This mimics the usual shutdown sequence: give the process a change to die gracefully (-TERM)...
2,716
Posted By megacoder
You've blocked the shell from expanding $cc with...
You've blocked the shell from expanding $cc with the single quotes:
cat in.file|awk -v cnt=0 -v replace="NEWSTUFF" "/$cc/{if (cnt=="0"){sub(/$cc/,replace)};cnt++} {print}" > out.file
Of course, now...
26,560
Posted By megacoder
awk(1) one-liner
awk '{ print NF ? $0 : ++n }'
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 09:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy