I am a bit new to linux shell scripting, so this could be a very silly question.
This is a simple example code (of course it does not work, but I am hoping to show what I wanna do):
#!/bin/bash
function AppendLetters() {
# Value sent as parameter: $1
$1= "$1"LLL
}
var="foo"
AppendLetter $var
echo "$var"
So, when calling the program from command line:
$ ./example.sh
I would like to modify the internal variableobtain some sort of:
fooLLL
Reason for doing this: I have a script that loads multiple variables from a config file, and would like to make the same modification to that variables in order to use them in my program.
Is it possible? Can a function modify variables sent as parameter?