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.
HI
I am trying to create a bash script to print whatever i type in
It has to have these below to define the size of the label and what size to print the text
Code:
N
q609
A100,10,0,5,2,2,N," "
P1
It has to be sent to below
Code:
> /dev/usblp0
So what it has to be is
Written Text ----> sent to printer
and i want to be able to write what i want to print
PLEA
Hey guys,
Code:
a=`cat abc | wc -l`
b=`cat def | wc -l`
if $a== $b
then
echo "a"
else
echo "b"
fi
I want the if condition to retry itself , untill a==b.
I can't use goto statemt.
Please help.
Thanx in advance.
Moderator's Comments:
Please use next time code
when i run this command:
Code:
tail -200 /var/log/httpd/access_log | awk -F'[][]' '{sub(/:[^:]*$/,"",$2);print $2}'
i get:
Code:
13/Aug/2012:20:56
13/Aug/2012:20:56
13/Aug/2012:20:56
13/Aug/2012:20:56
13/Aug/2012:20:56
13/Aug/2012:20:56
13/Aug/2012:20:56
13/Aug/2012:20:56
13/Aug/2012:20:56
13/Aug/2012:20:56
13/Aug/2012:20:56
now i need to alter the awk command
I want the difference between two following date using scripts in terms of no.of days.
Hi,
I've got a text file with hundreds of lines I need to upload to an API via curl, one by one.
The text file is like:
Code:
2012-08-01 10:45,124
2012-08-02 10:45,132
2012-08-03 10:45,114
I want to get curl to go through the text file sending a post for each line.
like:
Code:
curl --request POST http://website/api/post?apikey=$key\&time=$timestamp\&json={meter1:$data}"
Hi Friend,
Need your help.
I have a file which has information of start time and End time . I need to find how much time takes to complete the job .
Hi all ,
Am using unix aix..
I have a lots of files in /pb directory
i have to grep only the begining with "a" files alone..
for ex ..
Code:
aaw
sew
qwe
aer
wq
ad
output:
Code:
aaw
aer
ad
can anybody help me...
Moderator's Comments:
Please use code tags next time for you
Hello
I am trying to substring the month in a date string
I am getting an error " bad substitution"
Code:
#!/bin/ksh
INPUT='20121225'
echo ${$INPUT:5:2}
exit 0
Very new in unix.
Thanks.
Moderator's Comments:
Please use code tags next time for your code and data.