Top Forums Shell Programming and Scripting TCL script to capture range of lines and create two independent variables Post 303040669 by Chubler_XL on Sunday 3rd of November 2019 06:50:15 PM
You could split on newline before doing a foreach like this:

foreach p [ split $var4 "\n" ] {
   puts $p

This User Gave Thanks to Chubler_XL For This Post:
Test Your Knowledge in Computers #610
Difficulty: Medium
Compared to Python, Perl has a relatively small Comprehensive Perl Archive Network (CPAN) library.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

trying to create a script with multiple variables...

I have created a script that prompts the user to enter three variables that are seperated by a space as the delimiter. It then performs a command 3 seperate times for each variable entered. I want the script to llow the user to enter as many variables as they may like and the script to... (5 Replies)
Discussion started by: Italy87
5 Replies

2. Shell Programming and Scripting

Script to capture new lines in a file and copy it to new file

Hi All, I have a file that gives me new line/output every 5 minutes. I need to create a script that capture new line/output besides "IN CRON_STATUS", in this case the new output is "begin ------ - -----------". I want this script to capture the line starting from "begin ------... (0 Replies)
Discussion started by: fara_aris
0 Replies

3. Shell Programming and Scripting

how to create and access a directory in the same script using variables

I have a working script that defines the paths using variables which is used to move a rename files that are being archived. Is there a way to create a directory in the path with the date as the name and then reference it when moving the file to it? Here is what I have tried with no luck.... ... (1 Reply)
Discussion started by: Snickyt0310
1 Replies

4. Shell Programming and Scripting

Wrap lines with awk to create SQL script

Greetings! Some of my files list hardware errors (we test electronic components), some have none. If the file name has no errors, I still want to display a message like "No error", else I display the error from the file itself. I came up with this (with help) for myfile in `find . -name... (2 Replies)
Discussion started by: alan
2 Replies

5. Shell Programming and Scripting

Bash script - printing range of lines from text file

I'm working on a new exercise that calls for a script that will take in two arguments on the command line (representing the range of line numbers) and will subsequently print those lines from a a specified file. Command line would look like this: ./lines_script.bash 5 15 <file.txt. The script would... (8 Replies)
Discussion started by: ksmarine1980
8 Replies

6. Shell Programming and Scripting

Shell script to create runtime variables based on the number of parameters passed in the script

Hi All, I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them ---------- export Numbr_Parms=$# export a=1 while do export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies

7. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

8. Shell Programming and Scripting

Dialog , capture multiples inputs in variables

Hi everyone , i am trying to do a shell script with dialog , but i have a problem capturing each input variable to then use "echo" to write those inputs on specific orders in a file . If i use this code : dialog --backtitle "Dialog Form Example" --title "Dialog - Form" \ --form "\nDialog... (1 Reply)
Discussion started by: pedropt
1 Replies

9. UNIX for Beginners Questions & Answers

TCL script to print range of lines between patterns

Hi I am having a code as stated below module abcd( a , b , c ,da , fa, na , ta , ma , ra , ta, la , pa ); input a , b, da ,fa , na , ta , ma; output c , ra ,ta , la ,pa ; wire a , b , da , fa ,na , ta , ma; endmodule I need to match the string... (1 Reply)
Discussion started by: kshitij
1 Replies

10. UNIX for Beginners Questions & Answers

TCL script to extract the file name and then create two independent list

I am having one problem as stated below Problem Description I am having some "sv" extension files , I am using "glob" to extract the matching files , Now in these matching files , I need to split them and extract the elements and create different lists. For example set files This... (1 Reply)
Discussion started by: kshitij
1 Replies
continue(3tcl)						       Tcl Built-In Commands						    continue(3tcl)


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)

Featured Tech Videos

All times are GMT -4. The time now is 05:55 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy