Assuming you have How are you.pdf
in a variable you can use parameter expansions:
% a="How are you.pdf"
% echo "${a// /.}"
How.are.you.pdf
The above is a bash expansion and doesn’t work in a POSIX shell. In that case sed
or simulare would be needed.
To rename all files in the current directory:
for a in *; do
[ -f "$a" ] || continue
mv -- "$a" "${a// /.}"
done
8
solved Link separated words [closed]