
4 May
2017
4 May
'17
12:53 a.m.
On 4 May 2017 at 10:38, Tim Connors via luv-main <luv-main@luv.asn.au> wrote:
On Tue, 2 May 2017, Andrew McGlashan wrote:
# The ./ with the ls is there on purpose to make it safer # from potential globbing issues for old_fn in $(ls ./*.jpg)
Just stop it right now! Stop doing that!
Just don't!
`for old_fn in *.jpg` is all you need, all you want. Then make sure "$old_fn" is properly quoted elsewhere.
Yep, good advice. For more information, see this wonderful and comprehensive documentation: http://mywiki.wooledge.org/BashPitfalls#for_i_in_.24.28ls_.2A.mp3.29 ( in case that link does not work, it is to Pitfall #1 at http://mywiki.wooledge.org/BashPitfalls )