Closed viyic closed 3 years ago
When subscripting a variable with single-element list, it adds a space.
; a = b ; echo $a$a bb ; echo $a(1)$a b b
Which could be annoying if you want to echo a specific string.
; test_program hello # msg = $* # echo "$msg" "hello" # echo "$msg(1)" "hello " # msg1 = $msg(1) # echo "$msg1" "hello"
Please see the doc/design on "free carets". In any case, you can add a caret in this situation to get the behavior you want. $a(1)^$a
$a(1)^$a
Ah yes, it works. Thank you!
When subscripting a variable with single-element list, it adds a space.
Which could be annoying if you want to echo a specific string.