bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with Windows 1.12.13 binary


From: Todd Denniston
Subject: Re: Problem with Windows 1.12.13 binary
Date: Thu, 04 May 2006 16:44:44 -0500
User-agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501)

Jim Hyslop wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark D. Baushke wrote:


longest=/tmp/cvsroot/another/and/another

echo $longest | sed 's:\(.*\)/\(.*\):\1 \2:' |
  read -s longer shorter

echo "$longest, $longer, $shorter"

$longer and $shorter do not retain their values outside the read
function.

I don't know how to explain it, but perhaps the following script will help you see some of it. The strange thing for me, was that I thought the first echo in min would not have any data because I had not defined longer & shorter prior to the myfunction call.

#! /bin/bash
longest="/tmp/cvsroot/another/and/another"
myfunction()
{
 read longer shorter
}
echo $longest | sed 's:\(.*\)/\(.*\):\1 \2:' > /tmp/junkme
 myfunction < /tmp/junkme
echo "$longest, $longer, $shorter"
longer=nothing
shorter=lessthannothing
echo $longest | sed 's:\(.*\)/\(.*\):\1 \2:'|read longer shorter
echo "$longest, $longer, $shorter"
longer=nothing
shorter=lessthannothing
echo $longest | sed 's:\(.*\)/\(.*\):\1 \2:' > /tmp/junkme
 myfunction < /tmp/junkme
echo "$longest, $longer, $shorter"


Though I do not have a copy, I have however read parts of one, the Oriley (bad spelling) bash book was very good on explaining some of this.

--
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane)
Harnessing the Power of Technology for the Warfighter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]