Can someone expalin the size difference between the two commands :
1. du -ks .
2. ls -laR | awk '{ sum += $5 } END { print sum/1024 }'
- $5 is the 5th column that displays the byte count
I thought that at least the two figures should be close since both are supposed to display the total...
Ron,
As far as I know, ( I'm a newbie too ) sed writes the output to stdout. Therefore you must redirect stdout to a file ( > file2 ). I am also trying to do the same as you, but I was thinking more along these lines:
If one can test whether the find and replace was done then we can do...
Thanks. That worked. I was on the right track. I did try the following combinations:
/^[0-9]/
/[0-9]+$/
but these did not work.
Once again, thanks a lot.
wube
I am currently writing a script that expects input to be keyed in, and I have to verify if the input is numeric or not.
#!/bin/sh
read input
echo $input | awk ' { if ( $0 ~ /[0-9]/ )
printf " input contains numerics only"
else printf " input...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.