X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=blobdiff_plain;f=get-var;fp=get-var;h=0000000000000000000000000000000000000000;hb=7fa2f50e2953afba6747ef216fa54cac6ebc7173;hp=9b8f93054f0a7ef0205fd2b42e30e4c0abead578;hpb=8bb28228de442ddfb613402ae29e6f7c8849c49f;p=bin.git diff --git a/get-var b/get-var deleted file mode 100755 index 9b8f930..0000000 --- a/get-var +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/perl -wn -BEGIN { - unless (defined ($var = shift)) { - print STDERR "Usage: $0 var-name\n"; - exit 1; - } -} -if (/^\Q$var\E=/) { - s/^\Q$var\E=//; - print, last unless /^'/; - do { - $quotes = (grep /'/g, (split //, $_)) % 3; - $inside = $quotes ... $quotes; - s/^'// if $inside == 1; - s/'$// if $quotes == 2 || $inside =~ /E0$/; - s/'\\''/'/g; - print; - last if $quotes == 2 || $inside =~ /E0$/; - } while (<>); -}