Skip to main content
16 events
when toggle format what by license comment
Apr 1, 2012 at 5:08 comment added wnoise The semi-"standard" way to redirect both standard out and standard error is >&, not &>. Bash and zsh support both. The various csh descendants only support the first. The nice thing about the first form is that on shells that don't support it, it is more likely to error, rather than run the command in the background.
Mar 19, 2011 at 12:16 vote accept Bruno Le Floch
Mar 17, 2011 at 20:34 history edited D4RIO CC BY-SA 2.5
added 209 characters in body
Mar 17, 2011 at 20:31 comment added D4RIO Hmm.. dash is a minimal shell. Good for the root restoring a system, but the hell for average users. If it's your system, make /bin/dash the root's shell (/etc/passwd), but link /bin/sh to bash or ksh or something like that, so your /bin/sh is a sane shell.
Mar 17, 2011 at 20:20 comment added Bruno Le Floch @D4RIO: perhaps add the > /dev/null 2>&1 version to your answer to make it complete?
Mar 17, 2011 at 20:19 comment added Bruno Le Floch @Gilles: I tried to be clever, thinking "my $SHELL is bash", but well. Indeed, \bin\sh is a symlink to \bin\dash. Mystery (essentially) solved. Thank you very much.
Mar 17, 2011 at 20:11 comment added Gilles 'SO- stop being evil' @BrunoLeFloch: Not /bin/bash, but /bin/sh. See if it's a symbolic link or a hard link, to /bin/ash, maybe. The easiest way to see this is ls -l /bin/*sh.
Mar 17, 2011 at 20:10 comment added D4RIO @BrunoLeFloch: AFAIK $SHELL is your user shell as defined in /etc/passwd, but makefile will try to use /bin/sh.
Mar 17, 2011 at 20:09 comment added Bruno Le Floch @Gilles: /bin/bash is not a symbolic link. So it's kind of odd that &> doesn't work. But I'll live with that unknown: the maintainer is happy to change to the more canonical form > /dev/null 2>&1.
Mar 17, 2011 at 20:03 comment added Bruno Le Floch @D4RIO: I'll propose that to the package maintainer. By the way, echo $SHELL yields /bin/bash, and bash --version gives 4.1.5(1)-release (i486-pc-linux-gnu)
Mar 17, 2011 at 20:03 comment added Gilles 'SO- stop being evil' @BrunoLeFloch: Check if /bin/sh is a symbolic link. Note that /bin/sh may not be the shell you're using interactively. Instead of mycommand &>dest (csh/bash/zsh-specific), you can write mycommand >dest 2>&1, which is portable to any shell that make might use.
Mar 17, 2011 at 20:00 comment added D4RIO Yes, but then, you should use '>/dev/null 2>&1' instead
Mar 17, 2011 at 19:56 comment added Bruno Le Floch @Gilles: <noob question> how do I know what shell I'm using? And is there a protable alternative?
Mar 17, 2011 at 19:50 comment added Gilles 'SO- stop being evil' @Bruno: &> is an extension provided by some shells (including bash) to redirect both stdout and stderr to the same destination, but it's not portable. It's likely that the author of the Makefile has bash as his /bin/sh, but you have ash or ksh which doesn't support this syntax.
Mar 17, 2011 at 19:47 comment added Bruno Le Floch Thank you for your quick answer. That seems reasonable. Is it possible to avoid changing the Makefile? (I doubt it) I'll ask the maintainers of the Makefile why they did it that way and report back here.
Mar 17, 2011 at 19:43 history answered D4RIO CC BY-SA 2.5