Sponsored Content
Full Discussion: File globbing order
Top Forums Shell Programming and Scripting File globbing order Post 303028634 by Don Cragun on Friday 11th of January 2019 03:11:47 PM
Old 01-11-2019
Hi Scrutinizer,
Good catch. I didn't notice the leading XYX in one of the filenames!

Cheers,
Don
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk / bash globbing question

I would like to process a list of files matching: GPS*\.xyz with an awk script. I would then like to output the files to GPS*\.xyz.out (e.g. the same file name appended with .out). Something like: awk '{if(NR==1) {offset=-$1}; $1=$1+offset; print }' GPS*.xyz this does exactly what I want EXCEPT... (3 Replies)
Discussion started by: franzke
3 Replies

2. Shell Programming and Scripting

Globbing slash Wildcarding Question

I am on HP-UX and I am trying to come up with a method to call in a list of files named like so. filename020107.dat filename020207.dat filename020307.dat Obviously I can list them ls them like so, ls filename*.dat. In case you did not notice the number is a date and I was hoping to match... (4 Replies)
Discussion started by: scotbuff
4 Replies

3. Shell Programming and Scripting

globbing, $# is too high after wildcard expansion in bash script

How can I pass in an argument such as "*.k" to a bash script without having to double-quote *.k and not having *.k `glob` to match all files in the pattern? I tried using noglob in my script but this didn't work the way I thought it would.. expansion is still occuring, $# is higher than I... (3 Replies)
Discussion started by: zoo591
3 Replies

4. Shell Programming and Scripting

creating a file in reverse order of another file

Hi, I have a requirement where i need to write a script to create the new file from the given input file with the data in reverse order (bottom to top) Sample data: Input File-------------- Java VB Oracle Teradata Informatica Output file:----------------- Informatica Teradata Oracle... (3 Replies)
Discussion started by: srilaxmi
3 Replies

5. Shell Programming and Scripting

Order file by lines

My script(3 arguments $1 = folder,$2 extension,$3 string) should do the following things: -Enter in the folder of $1(if exists). -Put ls *.$2 > temp.txt ( I use a temp file to store the result of ls command and if $2 = txt in this file I'll have all the .txt files of the folder) -Now I want to... (2 Replies)
Discussion started by: Max89
2 Replies

6. UNIX for Advanced & Expert Users

Write to a file in a specified order

This is my input file : FCBAFE572C5E4BA29B3F8030BD480A94,907 ,1/1/2003,12/31/2005,ACT,1,2010-05-07 04:42:26.380000 2345AD5D2BFB29C821C1BC3DE8B746A7,907 ,1/1/2004,1/31/2005,ACT,1,2010-05-07 04:42:26.380000 E45B7371EEC0D1AB00E1750B5BC661F7,907 ,1/1/2004,12/31/2006,ACT,1,2010-05-07... (14 Replies)
Discussion started by: gpsridhar
14 Replies

7. Shell Programming and Scripting

Globbing or not globbing

Hi guys, Here is a simple script. It writes the current time to specific files in a directory. The arguments are the names of the files to write the date to (without path nor extension). root:~# cat /usr/local/bin/dummy.sh #!/bin/sh -e for file in $@; do date >> /var/lib/$file.dat... (11 Replies)
Discussion started by: chebarbudo
11 Replies

8. UNIX for Dummies Questions & Answers

File globbing questions

hi guys, jus some file globbing questions sed "s/^.*on//" what does the full stop and asterisk means? i onli know that ^ means inverse or not (1 Reply)
Discussion started by: ment0smintz
1 Replies

9. Shell Programming and Scripting

Negation in Bash Globbing

$ ls -1 a.1 b.1 x_a.1 x_b.1 $ ls -1 * b.1 x_a.1 x_b.1 $ ls -1 ** a.1 b.1 x_a.1 x_b.1The last result is not as expected. Why? Thanks. (2 Replies)
Discussion started by: carloszhang
2 Replies

10. Shell Programming and Scripting

Manipulation row order in file

Hello, I am trying to replace the position of each row by the next row. OS: Ubuntu 18.04, bionic I'd appreciate your help. input_file: -O fileA wget http://x.y.z./a -O fileB wget http://a.b.c./d -O fileC wget http://q.f.s/t .. .. .. -O fileZZ wget http://r.t.y/u I expect: (6 Replies)
Discussion started by: baris35
6 Replies
catch(n)						       Tcl Built-In Commands							  catch(n)

__________________________________________________________________________________________________________________________________________________

NAME
catch - Evaluate script and trap exceptional returns SYNOPSIS
catch script ?resultVarName? ?optionsVarName? _________________________________________________________________ DESCRIPTION
The catch command may be used to prevent errors from aborting command interpretation. The catch command calls the Tcl interpreter recur- sively to execute script, and always returns without raising an error, regardless of any errors that might occur while executing script. If script raises an error, catch will return a non-zero integer value corresponding to the exceptional return code returned by evaluation of script. Tcl defines the normal return code from script evaluation to be zero (0), or TCL_OK. Tcl also defines four exceptional return codes: 1 (TCL_ERROR), 2 (TCL_RETURN), 3 (TCL_BREAK), and 4 (TCL_CONTINUE). Errors during evaluation of a script are indicated by a return code of TCL_ERROR. The other exceptional return codes are returned by the return, break, and continue commands and in other special situa- tions as documented. Tcl packages can define new commands that return other integer values as return codes as well, and scripts that make use of the return -code command can also have return codes other than the five defined by Tcl. If the resultVarName argument is given, then the variable it names is set to the result of the script evaluation. When the return code from the script is 1 (TCL_ERROR), the value stored in resultVarName is an error message. When the return code from the script is 0 (TCL_OK), the value stored in resultVarName is the value returned from script. If the optionsVarName argument is given, then the variable it names is set to a dictionary of return options returned by evaluation of | script. Tcl specifies two entries that are always defined in the dictionary: -code and -level. When the return code from evaluation of | script is not TCL_RETURN, the value of the -level entry will be 0, and the value of the -code entry will be the same as the return code. | Only when the return code is TCL_RETURN will the values of the -level and -code entries be something else, as further described in the doc- | umentation for the return command. | When the return code from evaluation of script is TCL_ERROR, three additional entries are defined in the dictionary of return options | stored in optionsVarName: -errorinfo, -errorcode, and -errorline. The value of the -errorinfo entry is a formatted stack trace containing | more information about the context in which the error happened. The formatted stack trace is meant to be read by a person. The value of | the -errorcode entry is additional information about the error stored as a list. The -errorcode value is meant to be further processed by | programs, and may not be particularly readable by people. The value of the -errorline entry is an integer indicating which line of script | was being evaluated when the error occurred. The values of the -errorinfo and -errorcode entries of the most recent error are also avail- | able as values of the global variables ::errorInfo and ::errorCode respectively. | Tcl packages may provide commands that set other entries in the dictionary of return options, and the return command may be used by scripts | to set return options in addition to those defined above. EXAMPLES
The catch command may be used in an if to branch based on the success of a script. if { [catch {open $someFile w} fid] } { puts stderr "Could not open $someFile for writing $fid" exit 1 } There are more complex examples of catch usage in the documentation for the return command. SEE ALSO
break(n), continue(n), dict(n), error(n), return(n), tclvars(n) KEYWORDS
catch, error Tcl 8.5 catch(n)
All times are GMT -4. The time now is 11:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy