10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a test file with the following format, It contains the username_date when the user was locked from the database.
$ cat lockedusers.txt
TEST1_21062016
TEST2_02122015
TEST3_01032016
TEST4_01042016
I'm writing a ksh script and faced with this difficult scenario for my... (11 Replies)
Discussion started by: humble_learner
11 Replies
2. Shell Programming and Scripting
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)
Discussion started by: pat_pramod
3 Replies
3. Shell Programming and Scripting
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)
Discussion started by: Ferocci
8 Replies
4. Shell Programming and Scripting
Hi,
I tried the following but giving me all the files in the directory ,
Where i need the files which are assigned to variable like below
#!/bin/ksh
Src_Dir="/home/etc"
file_nm ="ab.temp"
for File in `ls $Src_Dir/$file_nm*`
do
File=`basename $File`
echo $File
... (2 Replies)
Discussion started by: smile689
2 Replies
5. Shell Programming and Scripting
I'm looking for some help in figuring why my little bit of code will not process any entries other then the first one in my list.
while read line ;do
hostname=${line//\"}
a=`ssh user@$hostname uptime;echo $?`
if ];then
dt=`date`
touch... (6 Replies)
Discussion started by: whegra
6 Replies
6. Shell Programming and Scripting
Hi All,
I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies
7. Shell Programming and Scripting
Hi,
I am trying to read a file line by line inside of a while loop. This while loop is part of a here document.
while read line
do
ssh -t $2@$remotehost <<REMOTE
ls path/to/dir > $path_to_dir
while read line1
do
echo "LINE --- $line"
done... (4 Replies)
Discussion started by: mnanavati
4 Replies
8. Shell Programming and Scripting
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)
Discussion started by: alex_5161
6 Replies
9. Shell Programming and Scripting
Hi,
In ksh we use 'while read line' statement to read a file line by line. In my input file I have 5 spaces appended at the end of each line. When I use while read line statement it chops off the spaces at the end of each line
Inp.txt
aaaa<five spaces>
bbbb<five spaces>
cccc<five spaces>
... (3 Replies)
Discussion started by: chella
3 Replies
10. Shell Programming and Scripting
Hi All,
Is there any way to read the previous line in file reading ?
or
is there any way to read a line twice in KSH ?
thanks in advance !!
Srini (6 Replies)
Discussion started by: Srini75
6 Replies