Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating a bash script with echo, problem with shebang line

Tags:

bash

echo

shebang

I want to explain to some friends how to add multikey support to their linux systems at bootup but first I need them to make a bash script. I want to make a simple command for them to copy and paste and I'm testing out this command I made but it keeps throwing an error. Only when I add the shebang line which, well is important.

$ sudo echo -e "#!/bin/bash \nxmodmap \"keysym Alt_R = Multi_key\"" > /etc.init.d/multikey.sh

Any easy way to echo a shebang line?

like image 221
Isaiah Avatar asked Aug 02 '11 05:08

Isaiah


Video Answer


1 Answers

Use the other quotes.

sudo echo -e '#!/bin/bash\nxmodmap "keysym Alt_R = Multi_key"'
like image 150
Ignacio Vazquez-Abrams Avatar answered Sep 23 '22 03:09

Ignacio Vazquez-Abrams