[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

globstar syntax

From: Alex Reed
Subject: globstar syntax
Date: Mon, 19 Jan 2009 10:14:39 -0800 (PST)
User-agent: G2/1.0

Should the globstar (**) syntax allow for partial parameter matching
(i.e. **.c to find all *.c files in the current directory and its sub-

Currently this can be implemented like this:
for i in **; do if [[ ${i} =~ \.c$ ]]; then <my_operation>; fi; done

It would be pleasantly convenient if this were condensed to:
for i in **.c; do <my_operation>; done

Or even:
<my_operation> **.c

With 'shopt -s globstar', I think that the syntax:
<my_operation> **/*.c

accomplishes the same goal, but I'm not sure it's 'correct'.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]