Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

carriage return and spacing in "here documents"

Status
Not open for further replies.

hcclnoodles

IS-IT--Management
Jun 3, 2004
123
GB
As the title suggests, i am having some trouble figuring out how to pass spaces and carriage returns to a 'here document' ie




#!/bin/bash
/usr/local/install_script.sh <<SCRIPT
yes
no
<pass carriage return here>
yes
no
<pass a space and then a carriage return here>
exit
SCRIPT

any idea on how i do this would be greatly appreciated

regards
 
You may try something like this:
echo "\
yes
no
\r
yes
no
\r
exit
" | /usr/local/install_script.sh

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top