How to define two variable in foreach command??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to define two variable in foreach command??
# 15  
Old 08-22-2002
Yeah...the sorting is dependant on what is wanted to be acheived.

The 'ls' command will produce a sorted list of files in a directory.
The file containing the new names may or may not require sorting - depends on the users need. Sort may well be needed and used. But it may not too!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to prompt user to define a variable?

Hi everyone, Is it possible to define blank vaianbles and prompt user to fill them during the script execution? A very simple example: INPUT= OUTPUT= cut -f1-4 $INPUT | sed 's/hello/goodbye/g' | sort -uV > $OUTPUTThank you in advance! Best wishes (2 Replies)
Discussion started by: lsantome
2 Replies

2. Shell Programming and Scripting

Define variable from file.

HI I have file A.txt _1A _2A _3A _4A I want define all as different variable. $1A=_1A $2B=_2A $3C=_3A $4D=_4A Now i can use any variable in my script. (3 Replies)
Discussion started by: pareshkp
3 Replies

3. Shell Programming and Scripting

In Perl can i define a hash with value as variable?

Hi, Is it possible in perl to have a hash defined with variables as theirs key values, like: %account = ('username' => 'boy', 'password' => $password); Thanks (1 Reply)
Discussion started by: zing_foru
1 Replies

4. Shell Programming and Scripting

question about define variable.

Hi, Unix Gurus, In our existing file, there is a script like #!/bin/sh step=${1:-0} cur_step=10 if ... My question is what's "${1:-0}" mean? I know it defines a variable but I don't know what's (1:-0) mean? :wall: Thanks in advance. (2 Replies)
Discussion started by: ken002
2 Replies

5. Shell Programming and Scripting

bash - define a variable

Hello, I would like to define a variable based on another variable: a=5 b$a=100 This does not work. What is the right way to do it? Thanks ---------- Post updated at 07:37 PM ---------- Previous update was at 07:33 PM ---------- Found my answer with the search function (did not... (0 Replies)
Discussion started by: jolecanard
0 Replies

6. Shell Programming and Scripting

foreach variable used in awk (please help!!)

I have a list of markers, say marker.txt: rs913257 rs1018390 rs764180 and I need to know which ROW that each marker appears in another map file, say map.txt: a rs12354060 b rs913257 c rs6650104 d rs2185539 e rs6681105 f rs1018390 g rs764180 h rs12564807 i rs3094315 The result... (4 Replies)
Discussion started by: Zoho
4 Replies

7. Shell Programming and Scripting

How to define a variable with variable definition is stored in a variable?

Hi all, I have a variable say var1 (output from somewhere, which I can't change)which store something like this: echo $var1 name=fred age=25 address="123 abc" password=pass1234 how can I make the variable $name, $age, $address and $password contain the info? I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies

8. UNIX for Dummies Questions & Answers

define length of variable

I have a variable with a value of "05". When I add one to that variable, using the command: CURR_YY=`expr $CURR_YY + 1`, I get the value of "6", losing the leading zero (which is needed for passing to another script). How do I keep the leading zero? Thank you! (10 Replies)
Discussion started by: cbarker
10 Replies

9. UNIX for Dummies Questions & Answers

Using Grep to Define a Variable

I am using korn shell unix. I have a script that I am working with to do a check for me using a text file. #finds "Time" from the text file and cuts the second field from the #line A= grep Time test.txt | cut -f2 # the "#Missing" is being pulled from the second field of the text... (1 Reply)
Discussion started by: cspcspcsp
1 Replies
Login or Register to Ask a Question
continue(3tcl)						       Tcl Built-In Commands						    continue(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
continue - Skip to the next iteration of a loop SYNOPSIS
continue _________________________________________________________________ DESCRIPTION
This command is typically invoked inside the body of a looping command such as for or foreach or while. It returns a TCL_CONTINUE code, which causes a continue exception to occur. The exception causes the current script to be aborted out to the innermost containing loop command, which then continues with the next iteration of the loop. Catch exceptions are also handled in a few other situations, such as the catch command and the outermost scripts of procedure bodies. EXAMPLE
Print a line for each of the integers from 0 to 10 except 5: for {set x 0} {$x<10} {incr x} { if {$x == 5} { continue } puts "x is $x" } SEE ALSO
break(3tcl), for(3tcl), foreach(3tcl), return(3tcl), while(3tcl) KEYWORDS
continue, iteration, loop Tcl continue(3tcl)