Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running TinyCore Linux and when I tried to install RVM (needed a portable linux distro for QA Automation) I keep getting an error sh: syntax error:unexpected redirection.

I am unsure why I am getting this error since the echo $SHELL command returns BASH.

Any ideas on how I could get this working or get more details on the issue?

share|improve this question

migrated from stackoverflow.com Sep 11 '11 at 8:40

This question came from our site for professional and enthusiast programmers.

Some more detail on what commands you ran, how far they got, etc. might be useful. –  Karpie Sep 11 '11 at 7:29
@karpie Unfortunately, that is as far as it got once I typed in the command: bash < <(curl -s rvm.beginrescueend.com/install/rvm) –  JustAl Sep 11 '11 at 8:08

1 Answer 1

It looks like one of the scripts is running under /bin/sh but uses extended features of bash, possibly <<< or <(. You presumably have ash as /bin/sh; that's legitimate (and ash is measurably faster and uses less memory than bash, which is why many distributions don't put bash as /bin/sh), but occasionally you run into scripts that rely on bash yet start with #!/bin/sh.

That you have $SHELL set to bash is irrelevant, each script is executed by the shell indicated on the first line (the shebang, here #!/bin/sh). I've had a quick look at the RVM scripts, and it looks like all the ones that rely on bash extensions correctly start with #!/usr/bin/env bash. Do you have a prior existing ~/.rvm? If so, try moving it out of the way.

You can get an execution trace for a shell script by running the shell with the -x option. So run bash -x ./rvm and see where the error occurs. If the error occurs in a script called indirectly from the main rvm script, try adding set -x in the other scripts as well (immediately below the #! line), to see an execution trace for them. This should help locate the offending script.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.