Sponsored Content
Top Forums Shell Programming and Scripting Create an execution logic of script Post 302887576 by Scrutinizer on Sunday 9th of February 2014 03:14:18 AM
Old 02-09-2014
Try:
Code:
while read A && read B
do 
  printf "This is \$A: %s\n" "$A"
  printf "This is \$B: %s\n" "$B"
done < file

But maybe you mean this:
Code:
while read _ A _ && read _ B _
do 
  printf "This is the second value on the line, \$A: %s\n" "$A"
  printf "This is the second value on the line, \$B: %s\n" "$B"
done < file

The underscore is used to capture and discard the first field and a potential last field after the second field (if ever there should be one)

Last edited by Scrutinizer; 02-09-2014 at 04:30 AM..
 

3 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

create a periodic execution of a script?

Hello every body goal: create a script that control periodicly ( every 30 min ) if a process is already actif. How can I do that? thanks (3 Replies)
Discussion started by: hoang
3 Replies

2. Shell Programming and Scripting

How to create file execution in KSH shell

Dear all, I'm new in Unix system, I need help about how to create execution file. for example in my system i have file fg* when i open fg file i get : cmd='basename$0' $cmd "$@" how to create file like that (execution file) in KSH shell thank you for your help heru (4 Replies)
Discussion started by: heru_90
4 Replies

3. Shell Programming and Scripting

Execution problems with the jar -tvf command and "if" logic

Hi, I am reading a directory that has a list of jar files. I am searching these files for specific keywords. What i would like to do is write the address of the jar file to a new file if the search result is returned as false. For example; /home/user/JarDirectory/Examplefile.jar ... (2 Replies)
Discussion started by: crunchie
2 Replies
All times are GMT -4. The time now is 09:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy