Description:
[Detailed description of the problem, suggestion, or complaint.]
Problem in shell functions
I have the following in a script.
#!/bin/bash func() { echo $1 } func $1
The entire path of the above script is /home/user/bin/nothing, where 'nothing' is the script file name. "/home/user/bin" is in the PATH
Now I have appended the following line to my .bashrc file in '/home/user' directory.
. /home/user/bin/nothing 3
After getting into the bash shell, I typed "/home/user/bin/nothing" without any parameter. The output I got is
3 3
why is it printing 3 the second time, though I haven't given any parameter
Repeat-By:
[Describe the sequence of events that causes the problem
to occur.]
Fix:
[Description of how to fix the problem. If you don't know a
fix for the problem, don't include this section.]