chris@globetek.UUCP (chris) (02/05/86)
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...