Action disabled: media
en:cs:bash:variable
−İçindekiler
Bash Variables
Local Variables
foo=one printvalue() { local foo=two echo $foo } # This will print ''one'' to the console. echo $foo # This will print ''two'' to the console. printvalue # This will print ''one'' to the console. echo $foo
Environment Variables
One feature we will use for Scope is the system that exists in all Unix systems. For example, when we call a program in a script, all environment variables are copied into the scope of that program. In short, the variables we define in the called script can only be accessed if they are environment variables.
# create a new variable and set it: # -> This is a normal variable, not an environment variable! test_variable="Hello World." # Let's make it visible to all sub-processes by converting it to an environment variable: export test_variable
Taken from UCH Wiki. ===== EDITOR NOTES ===== https://wiki.ulascemh.com/doku.php?id=en:cs:bash:variable
en/cs/bash/variable.txt · Son değiştirilme: 2025/05/01 19:30 Değiştiren: ulascemh