I have this code snippet I am working on for a small project I am doing:
echo "Please enter SUID: ";
read $uid
uid_Assoc(){
arg1=$1
echo $1;
}
uid_Assoc
Now to start, I would like this to prompt for a string and read the string. From there I would like to pass that string as an argument and echo it out. But I am not sure how to pass the string off as a parameter. When I attempt to do something like:
uid_Assoc($uid)
It throws a syntax error (I figured that would be incorrect anyways). Are there any suggestions on how to do this?
UPDATE: I also tried re-arranging the code a bit to look like this:
function uid_Assoc(){
arg1=$1
echo $1;
}
echo "Please enter SUID: ";
read $uid
uid_Assoc $uid
But that didn't seem to work either.