I have a assignment in which I am passing a file pattern to a function as below:
line=FILE*.txt
getFlag $line
While the function is as below:
function getFlag
{
filepattern=$1
echo "File pattern is: $filepattern"
}
I need the output as
File pattern is: FILE*.txt
While I am getting output as a matching file name present in the folder as below:
File pattern is: FILE123.txt
Though I am passing a file pattern as a variable to the function it does not prevent variable expansion and the file name matching with the pattern in variable is getting passed.
Any help upon above much appreciated.