Change the default "command to update packages" to fix minor incompatibility problem?
xuanruiqi opened this issue · 5 comments
read
without arguments is an extension provided by some shells (like bash and zsh) not part of the POSIX standard, so it will result in some POSIX-compliant shells like dash
to exit immediately due to syntax error. Some users (like me) might have /bin/sh
linked to dash and strange things will happen. The current command:
gnome-terminal -e 'sh -c "sudo pacman -Syu ; echo Done - Press enter to exit; read" '
could probably be changed to something like
gnome-terminal -e 'sh -c "sudo pacman -Syu ; echo Done - Press enter to exit; read _" '
(the variable name doesn't matter, it's to be thrown away anyways). Or change sh
to refer explicitly to bash
, but (only personally) I would prefer read _
.
Users could change the command easily, but for some users the default can result in unexpected behavior and it could be annoying (and confusing as well).
Is changing the /usr/bin/sh link something many arch users do ?
I suppose a sizable minority does it. FWIW, there's a package in the AUR that does exactly that and has a bunch of users.
Ok, This will will not change the default behavior for existing users (I hate so much when that happens), so I guess it's a change we can make.
Done in 292e09a
Thank you! This could not change the default behavior. The bash extension is to store the value in a value called $REPLY
but since the variable is not used anyway, the behavior doesn't depend on the variable name.