Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename PDFs to encode week and lecture number #11

Open
pabigot opened this issue Feb 3, 2013 · 0 comments
Open

Rename PDFs to encode week and lecture number #11

pabigot opened this issue Feb 3, 2013 · 0 comments

Comments

@pabigot
Copy link

pabigot commented Feb 3, 2013

It's very helpful to have the pdfs in one location, but it would be even better if the week and lecture number prefixed the title so they could be sorted. The following shell code is one way to do the renaming.

for w in 1 2 ; do 
  ( cd week${w}
    for n in 0* ; do
      lnum=$(echo ${n} | cut -c 1-3)
      lnam=$(echo ${n} | cut -c 4-)
      ( cd ../pdfs
         git mv ${lnam}.pdf ${w}${lnum}-${lnam}.pdf )
    done )
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant