Kitaab

Parameter Substitution in Bash

tip linux cli bash

published 2022-04-16 00:19

updated 2022-04-16 00:19

percent-within-bracket construct removes characters off the end. hash-within-bracket construct that strips characters off the beginning.

for file in *.html
do
  mv "$file" "${file%.html}.txt"
done
for file in *.html
do
  mv "$file" "vimwiki${file#Writing/}.txt"
done

docs