$* is a collection of all incoming parameters for the function (script) where this line command is located
Similar to [email protected] without quotes, no difference
The difference is when the "" is amplified.
"$*" is treated as a string
"[Email protected]" is treated as n string (number of n= parameters)
For is a loop statement
This means that when file takes the value of each parameter, the loop body after do does
The complete statement is
For file in $*;d o
#some_command
Echo $file
Done
Above this is the loop to print each parameter.
#!/bin/sh
Filename= ' Find. /-name "*.h" '
For Atmpfile in ${filename}
Do
Dos2unix ${atmpfile}
chmod 755 ${atmpfile}
Done
Filename= ' Find. /-name "*.cpp" '
For Atmpfile in ${filename}
Do
Dos2unix ${atmpfile}
chmod 755 ${atmpfile}
Done
$FileName is the reference variable filename, you can also define the variable filename=/usr/local that defines the variable as the path name.
Shell programming for file in $*; What does it mean.