From eff52bf92083173fe91e1736a3e9aa907f7e529f Mon Sep 17 00:00:00 2001 From: Sekulum Forka Date: Sun, 16 May 2021 16:50:19 +0200 Subject: [PATCH] Variables: 2 dollarsignsin a row are equal to a single dollarsign now --- src/fsh.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fsh.nim b/src/fsh.nim index 709b562..42b87c5 100644 --- a/src/fsh.nim +++ b/src/fsh.nim @@ -179,6 +179,7 @@ proc readVariable(strm: Stream): string = result.add(strm.readSubstitution()) of ']', '}': stderr.write("Unexpected " & c & ".\n") + of '$': result = "$" else: result.add(c) while not strm.atEnd(): @@ -189,6 +190,7 @@ proc readVariable(strm: Stream): string = # evalVariable finds a value of a variable proc evalVariable(vari: string): string = + if vari == "$": return "$" if shellVariables.hasKey(vari): result=shellVariables[vari] elif envVariables.hasKey(vari):