From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "ZSH workers mailing list" <zsh-workers@sunsite.auc.dk>
Subject: More cygwin troubles (read builtin)
Date: Fri, 26 May 2000 16:55:20 +0400 [thread overview]
Message-ID: <000401bfc711$a5dfc3e0$21c9ca95@mow.siemens.ru> (raw)
this part of script tries to find out current "root" directory for
cygwin - with slightly unexpected result:
MW1G17C% mount
Device Directory Type Flags
C:\cygwin\bin /usr/bin user binmode
C:\cygwin\lib /usr/lib user binmode
C:\cygwin / user binmode
The part of script:
mount | while read dev mpoint rest
do
[[ $mpoint == / ]] && {
local CYGWIN=$dev
break
}
done
results in
...
+/usr/local/share/zsh/site-functions/vi:8> [[ / == / ]]
+/usr/local/share/zsh/site-functions/vi:9> local CYGWIN=C:cygwin
+/usr/local/share/zsh/site-functions/vi:10> break
...
oops! read parsed input and lost backslash.
I could use "raw" read, but then, I have to check for line ends myself
... and for a long time I wish for a "read a line without parsing"
option, that may be useful anyway.
So, the suggestion is - add an option with the above meaning; then the
above could be rewritten as (assuming, -R is raw mode)
read -R line
[[ ${${=line}[2]} == / ]] && CYGWIN=${${=line}[1]}
Of course, if "device" has spaces, we get another problem ... something
like
mount "c:\my favourites" /favorites
-andrej
Have a nice DOS!
B >>
reply other threads:[~2000-05-26 12:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000401bfc711$a5dfc3e0$21c9ca95@mow.siemens.ru' \
--to=andrej.borsenkow@mow.siemens.ru \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).