Hi,
I am getting this error while running the following code.
Code:
i=`awk '{print $2}' test1.txt`
j=`awk '{print $4}' test1.txt`
k=`awk '{print $6}' test1.txt`
if [ $i =="Yes" && $j =="Yes" && $k =0 ]; then
echo "Up."
else
echo "down"
fi
rm -f test.txt test1.txt
error is this:
Code:
line 12: [: missing `]'
Please suggest.
I was just curious about how to sum the total file size of a certain type of file. For instance:
Code:
$find . -name "*.aif"
will print out the paths to each .aif file. Instead of printing, how could one sum the total space used by all of the aif files?
Suppose your piping a path into xargs and want to print the name along with the total size:
Code:
find . -maxdepth 1 | xargs -I {} echo "{} [`du -hs {} | sed 's/ [[:alnum:][:punct:]]*//g'`]"
This won't work because {} ceases having its special meaning within the ``. How to preserve it?
All,
Q: how would I add some escape codes to an interface that i have setup t print.?
Goal: to switch from NLQ to Util modes. back and forth.
Scenerio:
SCO OS 5.05
PRINTER: OKI Data 320 or similar. printer is called "test"
What I have done thus far.
Hi,
I wanted to create a control file with data in it.
Also wanted to append more points like
1)Row count, then print the first field
2)first line of the file
3)last line of the file
I started with this:-
Code:
ls -ltr *.*| awk ' { print $9 "|" $7 $6 $8 "|" $5 } '
sed -n '1p';
sed -n '$p';
Moderator's Comments:
Hello,
i try to create dir in C like that:
Code:
mkdir("/home/chercheur/1");
but when i try to open this directory: i have this message
Code:
Vous n'avez pas les permissions nécessaires pour afficher le contenu de «*1*».
have you an idea please
Thank you.
Moderator's Comments:
Hi,
My input file as follws
$ cat 1.txt
-------
Code:
a aa aaa 11
b bb bbb 22
I am able to extract first and last column of a given line as follows.
Code:
$ nawk '{print $1}' FS= RS= 1.txt | awk '{ $NF = ""; print }'
a
Code:
$ nawk '{print $1}' FS= RS= 1.txt | awk '{ print $NF}'
11
however, the same is not working by using shell script.
Loop 19 weeks 9 hours ago Hi
I wrote shell script to do the flowing count from 5 and down but doesn’t work please see my program
Code:
#Bash
x=0
y=10
while (( x < y ))
do
(( x = x + 1 ))
grep -A $x 5 numbers >>file4.txt
done
these the output
Code:
5
6
5
6
7
5
6
7
8
5
6
7
8
9
5
6
7
8
9
10
5
6
7
8
9
10
5
6
7
8
9
10
Moderator's Comments:
Dear friends,
I have a file with the text:
Code:
href="/archive/ip=x.x.x.x">M</a></td>
I want to extract just the IP number.