Search Results

Search: Posts Made By: peuceul
2,164
Posted By ningy
top -n 1 | awk '{ if (NR==4) print int($5) }'
top -n 1 | awk '{ if (NR==4) print int($5) }'
3,753
Posted By cero
Hi, you script currently overwrites log.txt...
Hi,
you script currently overwrites log.txt every second. Use >> to append.
while [ 1 ]
do
ps ax|grep 5060 >> log.txt
echo " " >> log.txt
sleep 1
done
1,199
Posted By ahamed101
A space is missing 2 and ] The operand is...
A space is missing 2 and ]
The operand is missing in the second elif statement

Try this... -ne means "not equal to"...

#!/bin/sh
if [ $# -ne 2 ]; then
echo "Invalid no. of arguments......
9,458
Posted By clx
`...` or $(...) will actually execute the...
`...` or $(...) will actually execute the command.
with "...", you are actually just assigning the literals.


#!/bin/bash
CMD=$(shuf -i 1-5 -n 1)

echo $CMD
exit 0


PS : welcome to...
Showing results 1 to 4 of 4

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