I'm investigating why application started by wine
so longer outputs correct font / encoding with LANG=ru_RU.UTF-8 wine program.exe
https://stackoverflow.com/questions/33379035/wine-and-cyrillic-fonts.
As I started to analyze I discovered (checked on two PCs with Linux Mint slightly different versions):
var1="var" echo "$var1"
outputs empty string / line in bash. Why?
It AFAIK worked with LANG
and wine
. man bash
:
A simple command is a sequence of optional variable assignments fol‐ lowed by blank-separated words and redirections, and terminated by a control operator.
If no command name results, the variable assignments affect the current shell environment. Otherwise, the variables are added to the environ‐ ment of the executed command and do not affect the current shell envi‐ ronment.
var1="var"; echo "$var1"
– waltinator Jan 21 '22 at 03:13echo
does not, but one withwine
does.? "This is because the shell expands the variable in the command line before it actually runs the command and at that time the variable doesn't exist." what is the point of optional variable assignments in a simple command syntax in such case? – Alex Martian Jan 21 '22 at 03:23var=value sh -c 'echo "$var"'
works as I would expect. The question is closed, thanks for help. – Alex Martian Jan 21 '22 at 03:28