yes i tried already with ksh. its running but the output is the same...one thing i observed, if i do a more input file name (smsT.ini) and copy the content of the file and create a new file name(smsT.txt) and paste it there and use that file it gives the required output...File size also getting decreased from the original file size value since while pasting all spaces are replaced to single space.
How to come out of this magical moments
tried as below but no hope
Code:
#!/bin/ksh
#sed -e "s/[ <tab>]*//g" /aemu/smsT.ini > /aemu/smsT.txt
while read line
do
echo $line | tr -s " "
done < /aemu/smsT.ini > /aemu/smsT.txt
while IFS== read -r key value; do
case $key in
MSISDN*) s=$s+$value ;;
SMSMSG) printf '%s=%s\n' "${s#+}" "$value"
s= ;;
esac
done< /aemu/smsT.txt > /aemu/SMSfileGen.txt
---------- Post updated 04-19-11 at 03:58 PM ---------- Previous update was 04-18-11 at 11:27 PM ----------
Hi,
Nothing is helping the cause...
pls tell me to read this output file so that i can assign the first row value to one variable and second row to another variable and repeat the process. Am going to use only two variables.
Quote:
278
=1415-3P-G in BSC jo Road II down at 17:01:14 18/04/2011
90278
=1415-3P-G in jo Road II UP at 17:13:14 18/04/11
assign like the one below.
Quote:
ms=278
sms=1415-3P-G in BSC jo Road II down at 17:01:14 18/04/2011
do something here...with these two variables
and loop through to assign the other two data in the same variable
ms=90278
sms=1415-3P-G in jo Road II UP at 17:13:14 18/04/11
do something here...with these two variables
---------- Post updated at 06:09 PM ---------- Previous update was at 03:58 PM ----------
Hi,
what is the mistake in the below code ?
Code:
num=2
count=$num
while read line
do
if [ "$count" != "1" ]; then
strMSID=$(echo $line)
count=`expr $count - 1`
else
lines=`echo $line | tr -s " "`
smstext=`echo $lines | sed -e 's/:/-/g'`
strsms=`echo $smstext | sed -e 's/ /+/g'`
echo $strsms
count=$num
echo "GET /cgi-bin/sendsms?username=an&password=ad&to=8445&text=$strsms HTTP/1.1"
(sleep 4; echo "GET /cgi-bin/sendsms?username=an&password=ad&to=8445&text=$strsms HTTP/1.1"; echo ""; sl
eep 5) | telnet 10.10.6.6 9080
fi
done< /home/SMS/SMSfile.txt
it give echoes out like
Quote:
1629-ParamanandaMdlySt-IV5-G+in+BSC+hbr+down+at+17-32-29+19/04/2011
GET /cgi-bin/sendsms?username=an&password=ad&to=8445&text=1629-ParamanandaMdlySt-IV5-G+in+BSC+hbr+dow HTTP/1.1-29+19/04/2011
Pls help me out..
Last edited by aemunathan; 04-18-2011 at 03:22 PM..
Hello
I'm stuck trying to solve this KSH issue and I'm hoping someone out there can offer some suggestions.
I want to read lots of large .gz files one line at a time in order to compare its Error entries with a list of known errors. I can't simply do "foreach ERROR do gzcat *.gz |grep... (2 Replies)
Hi,
I have gps receiver log..its giving readings .like below
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GPSD,R=1
$GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
I am using the while-loop to read a file.
The file has lines with null-terminated strings (words, actually.)
What I have by that reading - just a first word up to '\0'!
I need to have whole string up to 'new line' - (LF, 10#10, 16#A)
What I am doing wrong?
#make file 'grb' with... (6 Replies)
Hi ,
I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144
Now my script will check :
1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty.
2)then it executes a shell script called... (8 Replies)
Hello, I am quite new in shell scripting and I would like to write a little scritp to run a program on some parameters files.
all my parameters files are in the same directory, so pick them up with
ls *.para >>dirafter that I have a dir file like that:
param1.para
param2.para
etc...
I... (2 Replies)
Hi all
I have spent half a day trying to create a shell script which reads a configuration file on a line by line basis.
The idea of the file is that each will contain server information, such as IP address and various port numbers. The line could also be blank (The file is user created). Here... (1 Reply)
Hello,
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
Hi All,
Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool.
Wraper script am trying is to do with above metion 2 files.
utility tool accepts :
a. userinfo file : which contains username
b. item file : which... (2 Replies)
Hi all,
I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like:
<date1>|<data1>|<url1>|<result1>
<date2>|<data2>|<url2>|<result2>
<date3>|<data3>|<url3>|<result3>
<date4>|<data4>|<url4>|<result4>
What I... (3 Replies)
Hello,
I'm works on Ubuntu server
My goal : I would like to read file line per line, but i want to started at the end of file.
Currently, I use instructions :
while read line;
do
COMMAND
done < /var/log/apache2/access.log
But, the first line, i don't want this. The file is long... (5 Replies)