Sujet : Re: Long filenames in DOS/Windows and Unix/Linux
De : ralfixx (at) *nospam* gmx.de (Ralf Fassel)
Groupes : comp.unix.programmerDate : 04. Sep 2024, 10:47:53
Autres entêtes
Message-ID : <yga34mfoily.fsf@akutech.de>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
* Lawrence D'Oliveiro <
ldo@nz.invalid>
| On Tue, 03 Sep 2024 16:10:42 -0700, Keith Thompson wrote:
>
| > Lawrence D'Oliveiro <
ldo@nz.invalid> writes:
| >>
| >> On Tue, 03 Sep 2024 15:16:36 -0700, Keith Thompson wrote:
| >>>
| >>> For example, I might type something like:
| >>>
| >>> for file in * ; do cp -p $file $file.bak ; done
| >>
| >> It’s quite easy to fix that to work with spaces in file names.
| >
| > I wouldn't call it "quite easy".
>
| As easy as this, in Bash at least:
>
| IFS=$'\n'
Forgive my ignorance, but what is wrong with
for file in * ; do cp -p "$file" "$file.bak" ; done
? Works for both spaces and newlines in file names... (at least with
bash and ksh).
R'