Quote:
Originally Posted by
bbbngowc
... U"${i#P}"
U - is your prefix to the new filename, ( it can be anything ).
${i#P} - parameter substitution part,
$i - is the original filename,
# - operator that tells the shell to remove the pattern P from the filename, starting from the left to the right. Use
% operator to perform the removal procedure from right to the left of the filename. See also
## and
%% operators.
P - is simply your pattern that needs to be replaced. It can be any part of the filename that you need to remove, ex P08, then the command would have been
"${i#P08}" . The filenames might have spaces and other special characters, so it's always recommended using quotes-
"${...}".
Google key words "parameter substitution" to learn more.