Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site globetek.UUCP Path: utzoo!utcs!mnetor!globetek!chris From: chris@globetek.UUCP (chris) Newsgroups: net.sources.bugs Subject: Bcsh Patch #2 Message-ID: <222@globetek.UUCP> Date: Tue, 4-Feb-86 17:46:34 EST Article-I.D.: globetek.222 Posted: Tue Feb 4 17:46:34 1986 Date-Received: Tue, 4-Feb-86 19:15:30 EST Reply-To: chris@.UUCP (chris) Organization: Globetek Ltd., Toronto Lines: 59 This is Patch #2 for bcsh, the Bourne shell cshell-emulator. It is a context diff, suitable for use with patch (say 'patch < thisfile'). If you do not have patch, I will be happy to mail you a copy, or else you can simply apply the diffs by hand. Problem: ^foo^bar^ style command substitutions failed. Repeat by: Enter "echo foo foo foo", then "^foo^bar" or "^foo^bar^. Index: bcsh *** newbcsh Tue Feb 4 17:42:47 1986 --- bcsh Tue Feb 4 17:36:21 1986 *************** *** 841,847 ;; esac case "$cmd" in ! *\^*\^*) # see if the substitution is global --- 841,847 ----- ;; esac case "$cmd" in ! *\^*\^*\^*) # see if the substitution is global *************** *** 866,874 # find what substitution is wanted ! first="`expr \"$cmd\" : '.*\^\(.*\)\^.*\^.*'`" ! second="`expr \"$cmd\" : '.*\^.*\^\(.*\)\^.*'`" ! rest="`expr \"$cmd\" : '.*\^.*\^.*\^\(.*\)'`" cmd="`echo \"$lastcmd\" | sed -e \"s@$first@$second@$global\"`$rest" # see if the substitution worked --- 866,874 ----- # find what substitution is wanted ! first="`expr \"$cmd\" : '*\^\(.*\)\^.*\^.*'`" ! second="`expr \"$cmd\" : '*\^.*\^\(.*\)\^.*'`" ! rest="`expr \"$cmd\" : '*\^.*\^.*\^\(.*\)'`" cmd="`echo \"$lastcmd\" | sed -e \"s@$first@$second@$global\"`$rest" # see if the substitution worked -- Christine Robertson {linus, ihnp4, decvax}!utzoo!globetek!chris Money may not buy happiness, but misery in luxury has its compensations...