Re: shell scripts, spaces, and backslashes

2024-10-11 Thread Bruno Haible via Gnulib discussion list
Hi Chet, > > I wrote: > >> Stackoverflow [1] says that word-expansion must be > >> avoided, because it does not support the spaces in arguments > > > > These two examples show how non-intuitive shell scripts behave, > > regarding spaces and backslashes in arguments: > > > > $ printf '%s\n' a\\bc

Re: shell scripts, spaces, and backslashes

2024-10-11 Thread Chet Ramey
On 10/11/24 4:54 AM, Bruno Haible via Gnulib discussion list wrote: I wrote: Stackoverflow [1] says that word-expansion must be avoided, because it does not support the spaces in arguments These two examples show how non-intuitive shell scripts behave, regarding spaces and backslashes in argum

Re: relocatable-lib-lgpl: Add support for mingw builds on Cygwin hosts

2024-10-11 Thread Bruno Haible via Gnulib discussion list
> 2024-09-25 Bruno Haible > > build-to-host.m4: Add some convenience macros. More of the same kind: 2024-10-11 Bruno Haible bison-i18n: Add support for mingw builds on Cygwin hosts. * m4/bison-i18n.m4 (BISON_I18N): Define also BISON_LOCALEDIR_c and BISON_L

Re: shell scripts, spaces, and backslashes

2024-10-11 Thread Michele Locati
Il giorno ven 11 ott 2024 alle ore 11:00 Michele Locati ha scritto: > > > $ var='a\\bc\ d\\ef' > > $ printf '%s\n' $var > > a\\bc\ > > d\\ef > > And also: > > $ printf '%s\n' $var > a\\bc\ d\\ef Sorry, I meant printf '%s\n' "$var" a\\bc\ d\\ef

Re: shell scripts, spaces, and backslashes

2024-10-11 Thread Michele Locati
> $ var='a\\bc\ d\\ef' > $ printf '%s\n' $var > a\\bc\ > d\\ef And also: $ printf '%s\n' $var a\\bc\ d\\ef > Good luck understanding this! :D

shell scripts, spaces, and backslashes

2024-10-11 Thread Bruno Haible via Gnulib discussion list
I wrote: > Stackoverflow [1] says that word-expansion must be > avoided, because it does not support the spaces in arguments These two examples show how non-intuitive shell scripts behave, regarding spaces and backslashes in arguments: $ printf '%s\n' a\\bc\ d\\ef a\bc d\ef $ var='a\\bc\ d\\ef'