diff --git a/src/fsh.nim b/src/fsh.nim index 3787401..99ef403 100644 --- a/src/fsh.nim +++ b/src/fsh.nim @@ -28,6 +28,9 @@ let builtins: array[6, string] = [ "cd", ] +# number of frames to be used for builtins like set +var numframes: int=1 + # Exception types type ShellError= object of CatchableError @@ -254,7 +257,7 @@ proc runBuiltin(builtin: string, args: openArray[string]): (string, int) = of "set": if args.len < 2: raise newShellCommandException("Not enough arguments provided", "set") - shellVariables[0][args[0]] = args[1..^1].join(" ") + shellVariables[numframes-1][args[0]] = args[1..^1].join(" ") return ("", 0) of "setenv": if args.len < 2: