Re: ctrl m question
Re: ctrl m question
- Subject: Re: ctrl m question
- From: "John C. Welch" <email@hidden>
- Date: Thu, 14 Dec 2006 07:02:29 -0600
- Thread-topic: ctrl m question
On 12/1/06 16:35, "Mark J. Reed" <email@hidden> wrote:
> Note that in the shell, control-M is not actually an EOL. There's
terminal
> handling code which does magic to translate it - you hit the
return key,
> control-M gets sent, but the shell sees control-J instead.
(The same terminal
> handling code does the control-V stuff). But
that's only there when you're
> talking to a terminal - which "do shell
script" isn't. So you don't need to
> do anything special with carriage
returns - they're just another character to
> the shell, and you may
sprinkle them liberally throughout your command
> strings.
If, on the other hand, you want to send a literal newline
> (ASCII
character 10) and not have the shell treat it as "end of command",
> it
needs to be inside quotation marks or preceded by a backslash.
> On 12/1/06, Ian Ward Comfort <email@hidden> wrote:
>>> On Dec 1, 2006, at 2:04 PM, John C. Welch wrote:
>>> Okay, so to create a ^M for an eol in the shell, you hit ctrl-v
then
>>> ctrl-m.
What would be the best way to represent that in a do shell script
>>> command,
as "^M" is just two characters?
>> The "return" constant in AppleScript is actually ASCII
>> character 13.
> So this:
>
> set x to (do shell script "echo " & return & " |
>> cat -v")
> display dialog x
>
> pops up a dialog reading ^M on my system.
Sorry for the delay in responding here, I think I asked the question poorly.
What I need to do is strip the return/EOL so that a given line is now joined
with the line that follows.
--
"Hard pressed on my right. My center is yielding. Impossible to maneuver.
Situation excellent. I am attacking."
- Ferdinand Foch at the Battle of the Marne
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden