Computing.Net > Forums > Linux > howto put ctrl chars in bash script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

howto put ctrl chars in bash script

Reply to Message Icon

Name: Peter Marshall
Date: May 8, 2003 at 05:27:53 Pacific
OS: intell
CPU/Ram: 256
Comment:

I am trying to put ctrl-d in my bash script. (need to execute a command that needs ctrl-d to end the command). Does anywone know how to put it in the script ?
I tried doing the following
echo -e "\005" ;did not work
^D ;did not work
^d ;did not work
echo ^d ;did not work
echo "^D" ;did not work
echo `^D` ;did not work

anyway, if you have any ideas, it would be much appriciated.

thanks
Peter




Sponsored Link
Ads by Google

Response Number 1
Name: gmoney
Date: May 12, 2003 at 20:42:03 Pacific
Reply:

Not sure if this will work but in the 'man bash' documentation in the listing of backslash-escaped characters they list:

\cx a control-x character

so try

echo $'\cd'

or

echo $'\cD'

it didn't close the terminal for me so I hope you're not trying to do that?


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: howto put ctrl chars in bash script

help in Bash script www.computing.net/answers/linux/help-in-bash-script/20035.html

Separating commands in bash scripts www.computing.net/answers/linux/separating-commands-in-bash-scripts/20341.html

How logout from login-menu bash script? www.computing.net/answers/linux/how-logout-from-loginmenu-bash-script/9016.html