zsh-users
 help / color / mirror / code / Atom feed
* Passing parameters completely untouched
@ 2005-05-05 22:02 zzapper
  2005-05-06  4:02 ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: zzapper @ 2005-05-05 22:02 UTC (permalink / raw)
  To: zsh-users

Hi,
In the same family as previous posting



I want to be able to pass a string with backquotes w/o them being interpreted

eg

> convert_path "c:\aaa\fred\file.txt"

now I KNOW I can do

> convert_path "c:\\aaa\\fred\\file.txt"

 I guess I know that it's impossible (for any shell)
-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing parameters completely untouched
  2005-05-05 22:02 Passing parameters completely untouched zzapper
@ 2005-05-06  4:02 ` Bart Schaefer
  2005-05-06 12:36   ` zzapper
  0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2005-05-06  4:02 UTC (permalink / raw)
  To: zsh-users

On May 5, 11:02pm, zzapper wrote:
}
} I want to be able to pass a string with backquotes w/o them being
} interpreted

You mean backslashes, apparently, not backquotes?

} > convert_path "c:\aaa\fred\file.txt"

Use single quotes, man.

> convert_path 'c:\aaa\fred\file.txt'

(I presume "> " is a zsh prompt and not a Windows "MS-DOS Prompt" prompt.
If the latter, you're out of luck.)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing parameters completely untouched
  2005-05-06  4:02 ` Bart Schaefer
@ 2005-05-06 12:36   ` zzapper
  2005-05-06 13:16     ` Hannu Koivisto
  0 siblings, 1 reply; 8+ messages in thread
From: zzapper @ 2005-05-06 12:36 UTC (permalink / raw)
  To: zsh-users

On Fri, 06 May 2005 04:02:07 +0000,  wrote:

>On May 5, 11:02pm, zzapper wrote:
>}
>} I want to be able to pass a string with backslashes w/o them being
>} interpreted

>
>} > convert_path "c:\aaa\fred\file.txt"
>
>Use single quotes, man.
>
Bart,
Doesn't work for me on Cygwin zsh 4.2.4 (i686-pc-cygwin) even with single quotes the backslash is
interpreted.

I've solved my problem though by reading the paste buffer from within the zsh function
-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing parameters completely untouched
  2005-05-06 12:36   ` zzapper
@ 2005-05-06 13:16     ` Hannu Koivisto
  2005-05-06 13:27       ` zzapper
  0 siblings, 1 reply; 8+ messages in thread
From: Hannu Koivisto @ 2005-05-06 13:16 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

zzapper <david@tvis.co.uk> writes:

> On Fri, 06 May 2005 04:02:07 +0000,  wrote:

Your MUA's quoting functionality seems a bit broken.

>>On May 5, 11:02pm, zzapper wrote:
...
>>} > convert_path "c:\aaa\fred\file.txt"
>>
>>Use single quotes, man.
>>
> Bart,
> Doesn't work for me on Cygwin zsh 4.2.4 (i686-pc-cygwin) even with
> single quotes the backslash is
> interpreted.

Works fine here with Cygwin zsh 4.2.4:

[prompt] > kala
#!/bin/zsh

echo -E $*
[prompt] chmod +x kala
[prompt] ./kala 'c:\kala\lahna.txt'
c:\kala\lahna.txt

It is probably that convert_path thing of yours that doesn't work.
For example, if I had omitted -E from my example, the output would
have been "c:kalalahna.txt".

-- 
Hannu


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing parameters completely untouched
  2005-05-06 13:16     ` Hannu Koivisto
@ 2005-05-06 13:27       ` zzapper
  2005-05-06 15:16         ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: zzapper @ 2005-05-06 13:27 UTC (permalink / raw)
  To: zsh-users

On Fri, 06 May 2005 16:16:01 +0300,  wrote:

>zzapper <david@tvis.co.uk> writes:
>
>> On Fri, 06 May 2005 04:02:07 +0000,  wrote:
>
>Your MUA's quoting functionality seems a bit broken.
>
>>>On May 5, 11:02pm, zzapper wrote:
>...
>>>} > convert_path "c:\aaa\fred\file.txt"
>>>
>>>Use single quotes, man.
>>>
>> Bart,
>> Doesn't work for me on Cygwin zsh 4.2.4 (i686-pc-cygwin) even with
>> single quotes the backslash is
>> interpreted.
>
>Works fine here with Cygwin zsh 4.2.4:
>
>[prompt] > kala
>#!/bin/zsh
>
>echo -E $*
>[prompt] chmod +x kala
>[prompt] ./kala 'c:\kala\lahna.txt'
>c:\kala\lahna.txt
>
>It is probably that convert_path thing of yours that doesn't work.
>For example, if I had omitted -E from my example, the output would
>have been "c:kalalahna.txt".

Hannu,
Thnx that works fine with echo -E

Funny the doc says that -E is default?!?

-E     disable interpretation of backslash escapes (default)




-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing parameters completely untouched
  2005-05-06 13:27       ` zzapper
@ 2005-05-06 15:16         ` Bart Schaefer
  2005-05-06 15:49           ` zzapper
  0 siblings, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2005-05-06 15:16 UTC (permalink / raw)
  To: zsh-users

On May 6,  2:27pm, zzapper wrote:
}
} Thnx that works fine with echo -E
} 
} Funny the doc says that -E is default?!?
} 
} -E     disable interpretation of backslash escapes (default)

Are you perhaps reading the doc for Cygwin's /bin/echo?  The Zsh doc entry
for the echo builtin looks like this:

----------
echo [ -neE ] [ ARG ... ]
     Write each ARG on the standard output, with a space separating
     each one.  If the -n flag is not present, print a newline at the
     end.  echo recognizes the following escape sequences:

    \a
          bell character
    [...and so on for other escapes...]
    \UNNNNNNNN
          unicode character code in hexadecimal

     The -E flag, or the BSD_ECHO option, can be used to disable these
     escape sequences.  In the latter case, -e flag can be used to
     enable them.
----------


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing parameters completely untouched
  2005-05-06 15:16         ` Bart Schaefer
@ 2005-05-06 15:49           ` zzapper
  2005-05-06 16:57             ` zzapper
  0 siblings, 1 reply; 8+ messages in thread
From: zzapper @ 2005-05-06 15:49 UTC (permalink / raw)
  To: zsh-users

On Fri, 06 May 2005 15:16:30 +0000,  wrote:

>On May 6,  2:27pm, zzapper wrote:
>}
>} Thnx that works fine with echo -E
>} 
>} Funny the doc says that -E is default?!?
>} 
>} -E     disable interpretation of backslash escapes (default)
>
>Are you perhaps reading the doc for Cygwin's /bin/echo?  The Zsh doc entry
>for the echo builtin looks like this:
>
drat!,  I un-thinkingly do a >man echo

http://zsh.sunsite.dk/Doc/Release/index-frame.html
-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Passing parameters completely untouched
  2005-05-06 15:49           ` zzapper
@ 2005-05-06 16:57             ` zzapper
  0 siblings, 0 replies; 8+ messages in thread
From: zzapper @ 2005-05-06 16:57 UTC (permalink / raw)
  To: zsh-users

Hi,thanx to all!

Of course the moral here is that it wasn't the parameter passing that was changing my parameters but
rather echo itself!!!

-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-05-06 16:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-05 22:02 Passing parameters completely untouched zzapper
2005-05-06  4:02 ` Bart Schaefer
2005-05-06 12:36   ` zzapper
2005-05-06 13:16     ` Hannu Koivisto
2005-05-06 13:27       ` zzapper
2005-05-06 15:16         ` Bart Schaefer
2005-05-06 15:49           ` zzapper
2005-05-06 16:57             ` zzapper

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).