I'm recursively counting lines in files whose format is given in command line as a parameter, e.g. *.txt... In this example I'm searching for all .txt files and counting their lines. Additionally, I have to echo input parameters. My problem is with echo, when I try "$1", it expands and echoes all the .txt files, also with '$1' it echoes $1... What I want is not to expand and just echo raw input, in this case *.txt.
EDIT:
I'm calling the script with 2 parameters, first is the starting directory of recursion, and the second one is the format of desired file type.
./script.sh test *.txt
Then, I need to echo both of the parameters and recursively count the lines of the files whose format is given with 2nd parameter
echo $1
echo $2
find /$1 -name "$2" | wc -l
This code isn't working currently, but I'm trying to fix parameter echo first.