I’m trying to run a script after curling it, but with an option — I get the error: /usr/bin/install: /usr/bin/install: cannot execute binary fil
curl https://raw.github.com/gist/2513225/a39232a94b25741ddb25e15755bddd5d71999b85/give-tourettes.sh | sh install
What syntax is wrong? Just some Friday shenanigans…
Apparently, what
curlsends to its standard output isn’t acceptable tosh. If I had to guess, the first line of the file is#!/bin/bash\rwhere the\ris a carriage return (CR), and the system can’t find a file with the CR in the name. (And the error report is confusing because the CR spoils the display.)Maybe you should pipe the output through
tr -d '\015'before submitting it to the shell.See: bash: injecting variable into string adds extra \r for a related issue.
Against this hypothesis:
sh installtries to run the fileinstallin the current directory as a shell script. That may not work. Did you mean to pipe it to justshto execute thetourettes.sh? Or are you expectinginstallto read its standard input (and if so, why)?The ‘lose the carriage return’ advice is partially relevant; you don’t want CR in the data, but it may not be the only, or even the main, issue here.