From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 970 invoked from network); 26 May 2000 12:55:46 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 26 May 2000 12:55:46 -0000 Received: (qmail 25306 invoked by alias); 26 May 2000 12:55:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11597 Received: (qmail 25296 invoked from network); 26 May 2000 12:55:36 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: More cygwin troubles (read builtin) Date: Fri, 26 May 2000 16:55:20 +0400 Message-ID: <000401bfc711$a5dfc3e0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 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 >>