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):