Search Results

Search: Posts Made By: ajaypatil_am
4,781
Posted By jayan_jay
Use backslashes .. $ ssh user@servername...
Use backslashes ..

$ ssh user@servername "a=\$(hostname); echo \$a"
servername
$
4,781
Posted By itkamaraj
use nawk instead of awk
use nawk instead of awk
4,781
Posted By itkamaraj
can you post the command you tried.
can you post the command you tried.
4,781
Posted By itkamaraj
try this. h=$(hostname);df -k | awk -v...
try this.


h=$(hostname);df -k | awk -v h="$h" '!/dcs/ && NR>1 {if(substr($5,0,length($5)-1)>87)print h" "$5" " $6}' >> sms.txt
1,725
Posted By yazu
Yes.
Yes.
1,725
Posted By yazu
find .. -type d -mtime +1 | while read d; do ...
find .. -type d -mtime +1 | while read d; do
[ -z "`ls "$d"`" ] && echo rmdir "$d"
done

Try and if it works remove "echo".

PS It is unclear what it means - "1 day old" for directories....
13,346
Posted By mirni
On my Linux box, it doesnt work on either sh nor...
On my Linux box, it doesnt work on either sh nor bash:

$ ls file*
file1 file2 file3 filelist
$ cat testf.sh
#!/bin/sh
if [ -f file* ] ; then
echo exist multiple
fi
$ ./testf.sh
[:...
13,346
Posted By itkamaraj
ok, try this.. $? is a special variable...
ok, try this..

$? is a special variable which tells, the previous command is success or not.

if it holds 0, then it success.


ls -l /a/b/c/d/e/K*-*-*-*.s > /dev/null
if [ "$?" -eq "0"...
Showing results 1 to 8 of 8

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