Sponsored Content
Full Discussion: Globbing or not globbing
Top Forums Shell Programming and Scripting Globbing or not globbing Post 302708227 by Skrynesaver on Monday 1st of October 2012 09:08:39 AM
Old 10-01-2012
You will need to call the script like so
Code:
dummy.sh a\*.dat

because the glob expansion happens in the shell, not the script Smilie
 

6 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. 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

5. 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

6. Shell Programming and Scripting

File globbing order

Hi , I'm facing a different behaviour with one of my shell script for last few days. It was working good before that. here is my code for the script FileRemove.sh #get the file name# file1=$1 file2=$2 rm $file1 # delete the old file mv $file2 <target path> #move the new file to the target... (5 Replies)
Discussion started by: poova
5 Replies
HFSUTILS(1)						      General Commands Manual						       HFSUTILS(1)

NAME
hfsutils - tools for reading and writing Macintosh HFS volumes SYNOPSIS
hattrib - change HFS file or directory attributes hcd - change working HFS directory hcopy - copy files from or to an HFS volume hdel - delete both forks of an HFS file hdir - display an HFS directory in long format hformat - create a new HFS filesystem and make it current hls - list files in an HFS directory hmkdir - create a new HFS directory hmount - introduce a new HFS volume and make it current hpwd - print the full path to the current HFS working directory hrename - rename or move an HFS file or directory hrmdir - remove an empty HFS directory humount - remove an HFS volume from the list of known volumes hvol - display or change the current HFS volume hfssh - Tcl interpreter with HFS extensions hfs - shell for manipulating HFS volumes xhfs - graphical interface for manipulating HFS volumes DESCRIPTION
hfsutils is a collection of tools and programs for accessing Macintosh HFS-formatted volumes. See the accompanying man page for each pro- gram above for more information. NOTES
These utilities can manipulate HFS volumes on nearly any medium. A UNIX path is initially specified to hmount or hformat which gives the location of the volume. This path can be a block device -- corresponding to, for example, a floppy disk, CD-ROM, SCSI disk, or other device -- or it can be a regular file containing an image of any of the above. The medium specified by the UNIX path may or may not contain an Apple partition map. If partitioned, it is possible for more than one HFS volume to be present on the medium. In this case, a partition number must also be given which selects the desired partition. This number refers to the nth ordinal HFS partition on the volume. (Other, non-HFS partitions are ignored.) Partition number 0 refers to the entire medium, disregarding the partition map, if any. HFS pathnames consist of colon-separated components. Unlike UNIX pathnames, an HFS path which begins with a colon (e.g. :Foo:Bar) is a rel- ative path, and one which does not (e.g. Foo:Bar) is an absolute path. As sole exception to this rule, a path not containing any colons is assumed to be relative. Absolute pathnames always begin with the name of the volume itself. Any occurrence of two or more consecutive colons in a path causes reso- lution of the path to ascend into parent directories. Most of the command-line programs support HFS filename globbing. The following forms of globbing are supported: * matches zero or more characters. ? matches exactly one character. [...] matches any single character enclosed within the brackets. A character range may be specified by using a hypen (-). Note that matches are not case sensitive. {...,...} expands into the Cartesian product of each specified substring. causes the following character to be matched literally. Note that since globbing is performed by each HFS command rather than by the UNIX shell (which knows nothing about HFS volumes), care should always be taken to protect pathnames from the shell by using an appropriate quoting technique. Typically it is best to surround HFS pathnames containing glob characters with single quotes ('). Time stamps on HFS volumes are interpreted as being relative to the current time zone. This means that modification dates on HFS volumes written in another time zone may appear to be off by some number of hours. Hardware limitations prevent some systems from reading or writing native Macintosh 800K floppy disks; only high-density 1440K disks can be used on these systems. The obsolete MFS volume format is not supported by this software. SEE ALSO
hattrib(1), hcd(1), hcopy(1), hdel(1), hdir(1), hformat(1), hls(1), hmkdir(1), hmount(1), hpwd(1), hrename(1), hrmdir(1), hvol(1), hfs(1), xhfs(1) AUTHOR
Robert Leslie <rob@mars.org> HFSUTILS
08-Nov-1997 HFSUTILS(1)
All times are GMT -4. The time now is 04:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy