Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # chmod +x this_script.sh
- # usage: ./this_script *.txt
- for name in "$@"; do
- new=$(sed -r 's/^[^0-9]+/xxx/' <<<"${name}")
- if [[ -e "${new}" ]]; then
- echo "$0: ${new} already exists." >&2
- continue
- fi
- # remove 'echo' --> rename actually
- echo mv -v "${name}" "${new}"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement