Sponsored Content
Full Discussion: shopt -s nullglob
Top Forums Shell Programming and Scripting shopt -s nullglob Post 302254599 by cfajohnson on Tuesday 4th of November 2008 09:54:25 PM
Old 11-04-2008

As shopt -s nullglob is not standard, I'd use a test inside the loop:

Code:
for FILE in [AST]*.L1A_[GL]AC* S*.L1A_MLAC*; do
   [ -f "$FILE" ] || continue
   echo "$FILE"
   : ....
done

 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash 'shopt' doubt

Hi, I am using bash shell's extended pattern matching. What tweak the following code needs in order to get the expected output? shopt -s extglob f="a@b@_c@d@_e" echo "${f/@(@|@_)/__}" My expected output is: a__b__c__d__e but the actual output is: a__b@_c@d@_e # that is, how to... (3 Replies)
Discussion started by: royalibrahim
3 Replies

2. Shell Programming and Scripting

Bash, Bourne, and nullglob

I have a script that start out with this: #!/sbin/sh Several things run. However I cannot get: shopt -s nullglob to run in Bourne. I get: shopt: not found So within the main script (after #!/sbin/sh at the top) I start bash with: bash and try to run what I need with: shopt -s... (2 Replies)
Discussion started by: crowman
2 Replies

3. UNIX for Advanced & Expert Users

Shopt -s histappend

What is the point of this? Whenever I close my shell it appends to the history file without adding this. I have never seen it overwrite my history file. # When the shell exits, append to the history file instead of overwriting it shopt -s histappend (3 Replies)
Discussion started by: cokedude
3 Replies
All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy