Thread: Help with simple bash rename script
hey,
i'm trying learn bit shell scripts , know renaming practical, easy place start. i'm trying rename files of form
1-22bach-stmatthewpassion-part01-22.mp3
form:
#.mp3
# starts @ 1 , goes each additional file.
tried:
but got message saying missing operator before "bach". can help?code:#!/bin/bash j=1 in ls -n; rename * $j.mp3 $j = $((j + 1)) done
thanks!
this seems work:
this prevents dash character being interpreted parameter argument.code:#!/bin/bash i=1 file in *.mp3; mv -- "$file" "$i.mp3" i=$(($i+1)) done
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] Help with simple bash rename script
Ubuntu
Comments
Post a Comment