barbara to Linux · 7 months agowhy does noone inprove bash such that you can write a normal foor loop with whitespace in file names?message-squaremessage-square45fedilinkarrow-up131arrow-down117file-text
arrow-up114arrow-down1message-squarewhy does noone inprove bash such that you can write a normal foor loop with whitespace in file names?barbara to Linux · 7 months agomessage-square45fedilinkfile-text
minus-squarebizdelnicklinkfedilinkarrow-up5·7 months agoBecause you already can if you quote them properly. You can even use newline characters, vertical tabs and whatever you want.
minus-squarebizdelnicklinkfedilinkarrow-up5·7 months agoProof: $ ls 'file 1' 'file 2' 'file 3' $ for f in *; do echo "$f"; done file 1 file 2 file 3 $
Because you already can if you quote them properly. You can even use newline characters, vertical tabs and whatever you want.
Proof:
$ ls 'file 1' 'file 2' 'file 3' $ for f in *; do echo "$f"; done file 1 file 2 file 3 $