Operating System - HP-UX
1827283 Members
3573 Online
109717 Solutions
New Discussion

Re: Insert carriage return in a script

 
SOLVED
Go to solution
Charles Harris
Super Advisor

Insert carriage return in a script

I'm trying to remember how to get a carrage return in a normal command line for a quick port check script. Eg.

telnet "close" |telnet server port && echo "Open"

....but after the close, I need a return. I thought it was something like ctrl+y followed by something, but I can't remember!!!

Answers warmly received as ever!!!

Cheers,

-=ChaZ=-
3 REPLIES 3
Charles Harris
Super Advisor

Re: Insert carriage return in a script

ooops, the first bit of the command should have been an echo!! - Sorry!!

-=ChaZ=-
Ermin Borovac
Honored Contributor
Solution

Re: Insert carriage return in a script

To insert carriage return type Ctrl-V followed by or Ctrl-M.

Maybe you need ^] (Ctrl-]) instead?

echo "^]close" | telnet server port && echo "Open"
Charles Harris
Super Advisor

Re: Insert carriage return in a script

Good work thanks, I knew I'd forgotten something along the way!!!

Cheers,

-=ChaZ=-