Sponsored Content
Full Discussion: While Loop issue
Top Forums Shell Programming and Scripting While Loop issue Post 302874583 by Akshay Hegde on Friday 15th of November 2013 03:47:50 PM
Old 11-15-2013
Quote:
Originally Posted by onesuri
Hi,

Code:
i=0
t5=6000001
while [ $i -lt 100 ]
do

i=`expr $i + 1`
t5=`expr $t5 + 1`
echo $t5
done

I am able to increment "col3" value but unable to get col1,col2 value.


Input:

t1=10001
t2=abc
t3=ghkc
t4=cbf
t5=6000001


output
col1,col2,col3,col4,col5,col6
10001,abc,6000001,,,,,,,
10001,ghkc,6000002,,,,,,,
10001,cbf,6000003,,,,,,,
10002,abc,6000004,,,,,,,
10002,ghkc,6000005,,,,,,,
10002,cbf,6000006,,,,,,,
10003,abc,6000007,,,,,,,
10003,ghkc,6000007,,,,,,,
10003,cbf,6000008,,,,,,,

Thanks
onesuri
Use codetag for data as well, after 73 posts don't you know that you have to use codetag for data as well as for code. and you have given input and output, could you please explain their relationship.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help With A For Loop Issue

I was wondering how I can modify this for loop, so it only loops through the filenames that do not have an ".old" extension. for filename in $(ls "$1") do echo $filename | grep '\.old$' > /dev/null if then mv $1/$filename $1/$filename.old fi done (5 Replies)
Discussion started by: ralts01
5 Replies

2. Shell Programming and Scripting

while loop issue

Hi, Following is my code and the file FILE_LIST_EXCESS.txt has 40 file names in it while read LineIn do echo ${LineIn} `ftp -vin << END_INPUT >> ${PID}_DS_GET_Log.log 2>&1 open servername user userid password cd FileDir get ${LineIn} END_INPUT`... (4 Replies)
Discussion started by: mgirinath
4 Replies

3. Shell Programming and Scripting

loop issue

I have 2 files one of them has all the all mac addresses and the other one has all the ip addresses. Basically, I want to loop thru those 2 files and generate a configuration like below: host www184.domain.com { hardware ethernet 00:13:72:3B:B4:3A; fixed-address 192.168.0.184; }... (4 Replies)
Discussion started by: kkkk
4 Replies

4. Shell Programming and Scripting

loop issue

function ext { echo "THANKS & WELCOME BACK" } function upc { echo "TO EXPORT UPROC GIVE UPROC NAME PER LINE IN THE input.txt and PRESS Y" echo "TO GO BACK PRESS 99" read parm0 if ; then start elif ; then for i in `cat input.txt` ; do echo $i $UXEXE/uxext upr upr=$i... (0 Replies)
Discussion started by: kojo
0 Replies

5. Shell Programming and Scripting

until loop issue.

Hi, my script is waiting for 3 files to come to a folder for 30 min but even when all the files arrive in the folder it's still waiting for these three files. Files can come with in 2 min and I want it to start processing them immediately after all the files arrive in the folder. until ; do... (3 Replies)
Discussion started by: gurpartap
3 Replies

6. Shell Programming and Scripting

for-while loop issue

sup experts..i had a script which was bugging me..was hoping someone could point out the issue here Input file: space separated 2 columns I wanted to print out the 2 columns after assigning them to variables ( bascially the same output but iterate through line by line ). The code worked... (7 Replies)
Discussion started by: foal_newbie
7 Replies

7. Shell Programming and Scripting

Issue with using While loop

Hi, I am trying to move a file from remote server to local server and when the transfer completes successfully i call a script in remote server to remove the file which was successfully transferred. I do this by first getting the list of file in remote server and move the text file to local... (8 Replies)
Discussion started by: funonnet
8 Replies

8. Shell Programming and Scripting

Issue with while loop?

Hi, I have prepared a script to search for backup file information on the Linux server. Script works fine for the most part except the echo statement inside an IF conditional block displays the message ''snapshot directory not found on xxxxx" even though the .snapshot directory is found a... (11 Replies)
Discussion started by: svajhala
11 Replies

9. Shell Programming and Scripting

Issue with for loop

Hi Team, I have for loop in my shell script. Which basically loop through all files in the directory, When some files are in the directory it works just fine. But if there are no files at all..still the for loop try to execute. Please help. Below is the code. #!/bin/ksh echo "Program... (5 Replies)
Discussion started by: bharath561989
5 Replies

10. UNIX for Beginners Questions & Answers

Issue when doing a loop

Hi, I just have started learning shell scripting (sh). Why do i only get the date? while read dt do echo "Date : ${dt} sed -n '/${dt}/,/${dt}/p' file1.log | grep -w ERROR done < date1.dat INPUT - date1.dat 2019-04-05 04:58:25 2019-04-05 04:58:26 2019-04-05 05:00:56... (3 Replies)
Discussion started by: margel
3 Replies
OWLTTB(1)							  ICI executables							 OWLTTB(1)

NAME
owlttb - one-way light time transmission delay simulator SYNOPSIS
owlttb own_uplink_port# own_downlink_port# dest_uplink_IP_address dest_uplink_port# dest_downlink_IP_address dest_downlink_port# owlt_sec. [-v] DESCRIPTION
owlttb delays delivery of data between an NTTI and a NetAcquire box (or two, one for uplink and one for downlink) by a specified length of time, simulating the signal propagation delay imposed by distance between the nodes. Its operation is configured by the command-line parameters, except that the delay interval itself may be changed while the program is running. owlttb offers a command prompt (:), and when a new value of one-way light time is entered at this prompt the new delay interval takes effect immediately. own_uplink_port# identifies the port on owlttb accepts the NTTI's TCP connection for uplink traffic (i.e., data destined for the NetAcquire box). own_downlink_port# identifies the port on owlttb accepts the NTTI's TCP connection for downlink traffic (i.e., data issued by the NetAcquire box). dest_uplink_IP_address is the IP address (a dotted string) identifying the NetAcquire box to which owlttb will transmit uplink traffic. dest_uplink_port# identifies the TCP port to which owlttb will connect in order to transmit uplink traffic to NetAcquire. dest_downlink_IP_address is the IP address (a dotted string) identifying the NetAcquire box from which owlttb will receive downlink traffic. dest_downlink_port# identifies the TCP port to which owlttb will connect in order to receive downlink traffic from NetAcquire. owlt specifies the number of seconds to wait before forwarding each received segment of TCP traffic. The optional -v ("verbose") parameter causes owlttb to print a message whenever it receives, sends, or discards (due to absence of a connected downlink client) a segment of TCP traffic. owlttb is designed to run indefinitely. To terminate the program, just use control-C to kill it or enter "q" at the prompt. EXIT STATUS
0 Nominal termination. 1 Termination due to an error condition, as noted in printed messages. EXAMPLES
Here is a sample owlttb command: owlttb 2901 2902 137.7.8.19 10001 137.7.8.19 10002 75 This command indicates that owlttb will accept an uplink traffic connection on port 2901, forwarding the received uplink traffic to port 10001 on the NetAcquire box at 137.7.8.19, and it will accept a downlink traffic connection on port 2902, delivering over that connection all downlink traffic that it receives from connecting to port 10002 on the NetAcquire box at 137.7.8.19. 75 seconds of delay (simulating a distance of 75 light seconds) will be imposed on this transmission activity. FILES
Not applicable. ENVIRONMENT
No environment variables apply. DIAGNOSTICS
The following diagnostics may be printed to stdout: owlttb can't spawn uplink thread The program terminates. owlttb can't spawn uplink sender thread The program terminates. owlttb can't spawn downlink thread The program terminates. owlttb can't spawn downlink receiver thread The program terminates. owlttb can't spawn downlink sender thread The program terminates. owlttb fgets failed The program terminates. owlttb out of memory. The program terminates. owlttb lost uplink client. This is an informational message. The NTTI may reconnect at any time. owlttb lost downlink client This is an informational message. The NTTI may reconnect at any time. owlttb can't open TCP socket to NetAcquire The program terminates. owlttb can't connect TCP socket to NetAcquire The program terminates. owlttb write() error on socket The program terminates if it was writing to NetAcquire; otherwise it simply recognizes that the client NTTI has disconnected. owlttb read() error on socket The program terminates. owlttb can't open uplink dialup socket The program terminates. owlttb can't initialize uplink dialup socket The program terminates. owlttb can't open downlink dialup socket The program terminates. owlttb can't initialize downlink dialup socket The program terminates. owlttb accept() failed The program terminates. BUGS
Report bugs to <ion-bugs@korgano.eecs.ohiou.edu> perl v5.14.2 2012-05-25 OWLTTB(1)
All times are GMT -4. The time now is 06:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy