Random parser error of $() when there is a case inside
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.2 -L/home/abuild/rpmbuild/BUILD/bash-4.2/../readline-6.2 Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-suse-linux-gnu' -DCONF_VE NDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -fmessage-length=0 - grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -D_GNU_SOURCE -DRECY CLES_PIDS -Wall -g -Wuninitialized -Wextra -Wno-unprototyped-calls -Wno-switch-enum -Wno-unused-variable -Wno-unused-parameter -ftree-loop -linear -pipe -DBNC382214=0 -DIMPORT_FUNCTIONS_DEF=0 -fprofile-use uname output: Linux tresc031501 3.16.7-29-default #1 SMP Fri Oct 23 00:46:04 UTC 2015 (6be6a97) x86_64 x86_64 x86_64 GNU/Linux Machine Type: x86_64-suse-linux-gnu Bash Version: 4.2 Patch Level: 53 Release Status: release Description: While writing a script, I faced a random parser error with code like A=$( ... case b in c) ... esac ... ) Minor changes like renaming a variable skips the problem. It seems that the parser gets confused in some cases. Repeat-By: Run the script bellow. The first block work. If I change the b name to bb, it fails! If I switch from $() to ``, it works: A=$( for b; do case c in d) echo 123 ;; esac done ) echo OK # Changed $() to `` A=` for bb; do case c in d) echo 123 ;; esac done ` echo OK # changed the name from b to bb!! A=$( for bb; do case c in d) #<- something with this echo 123 #<- and this runs!! check stdout! ;; esac done ) echo Fail OUTPUT: OK OK a.sh: command substitution: line 33: syntax error: unexpected end of file 123 a.sh: line 30: syntax error near unexpected token `;;' a.sh: line 30: ` ;;' -- Luiz Angelo -- Luiz Angelo Daros de Luca
Re: Installation of PDF/PS/DVI and HTML files
Hi, Linda Walsh writes: > Mathieu Lirzin wrote: >> Greg Wooledge writes: >>> The de facto standard for "make" followed "make install" on a >>> _Unix_-like system is to install man pages. >> >> For more _GNU_ standards [_emphasis_ mine] > --- > Notice you are comparing 'GNU' (new) standards compared to > older and established standards. Many of the newer standards fly in > the face of good design and throw-out previous 'best-practices' standards > for no other reason than to follow new standards that are not justifiable > based on user-utility nor sound computer science. The GNU standards were mentioned only because Bash is a GNU package. I wasn't implying that they are higher standards or anything like that. I was just reminding that within the GNU project, an info manual is mandatory and man pages are only optional (not the other way). -- Mathieu Lirzin
Re: Installation of PDF/PS/DVI and HTML files
Mathieu Lirzin wrote: Hi, Greg Wooledge writes: On Thu, Dec 03, 2015 at 01:08:13PM +0200, Ludovic Courtès wrote: Given that the GCS suggests installing only the Info version of the manual by default (info "(standards) Standard Targets") What do you think? I think that's a stupid suggestion. It would be nice to express your ideas in a polite way. The point was about achieving a reproducible build, not about droping the man page. Nevertheless, Gnu and others have made similarly well-suggested ideas regarding unix utils and architecture as to possibly leave some people a bit short on patience. The de facto standard for "make" followed "make install" on a _Unix_-like system is to install man pages. For more _GNU_ standards [_emphasis_ mine] --- Notice you are comparing 'GNU' (new) standards compared to older and established standards. Many of the newer standards fly in the face of good design and throw-out previous 'best-practices' standards for no other reason than to follow new standards that are not justifiable based on user-utility nor sound computer science. L. Walsh
Re: Installation of PDF/PS/DVI and HTML files
Hi, Greg Wooledge writes: > On Thu, Dec 03, 2015 at 01:08:13PM +0200, Ludovic Courtès wrote: >> Given that the GCS suggests installing only the Info version of the >> manual by default (info "(standards) Standard Targets") > >> What do you think? > > I think that's a stupid suggestion. It would be nice to express your ideas in a polite way. The point was about achieving a reproducible build, not about droping the man page. A constructive suggestion would have been better. Nonetheless when reading the actual bug report, the repoducibility problem seems to concern only the html and pdf. So keeping the 'text' prerequisite in the 'install' rule seems reasonable. Ludo: Am I missing something? > The de facto standard for "make" followed "make install" on a > Unix-like system is to install man pages. If there's an info page, I > have no objection to installing that as well, but to omit the standard > man pages by default is ridiculous. For more GNU standards background in regards of man pages, see: https://www.gnu.org/prep/standards/standards.html#Man-Pages -- Mathieu Lirzin
Re: Installation of PDF/PS/DVI and HTML files
Greg Wooledge skribis: > On Thu, Dec 03, 2015 at 01:08:13PM +0200, Ludovic Courtès wrote: >> Given that the GCS suggests installing only the Info version of the >> manual by default (info "(standards) Standard Targets") > >> What do you think? > > I think that's a stupid suggestion. The de facto standard for "make" > followed "make install" on a Unix-like system is to install man pages. > If there's an info page, I have no objection to installing that as well, > but to omit the standard man pages by default is ridiculous. Agreed; apologies for being unclear. As Mathieu wrote, I am of course fine installing man and Info manuals by default, like GNU packages generally do. The suggestion I make is to not install PDF/PS/DVI and HTML files by default. This would comply with the GCS and user expectations, and also sidestep the bit-for-bit reproducibility issues that generating those PDF/PS/DVI/HTML files entails. What do you think? Thanks, Ludo’.