The staff upload photos, menus and invoices from their phones into ~/uploads. The names have spaces: Team Photo 2.JPG, MENU winter.PDF, price list.txt. The web shop and the backups break on them. Ana wants one rule: - for each space.
Write ~/tidy.sh DIR:
learner@reef:~$ ./tidy.sh ~/uploads
Card Reader Manual.pdf -> Card-Reader-Manual.pdf
…
web shop banner.PNG -> web-shop-banner.PNGMake it runnable with chmod u+x ~/tidy.sh, and run it as ./tidy.sh ~/uploads.
You have 15 minutes. The clock starts when you start the challenge. If the time runs out, you can still finish.
The tests run your script on a fresh copy of these 20 files, ~/test-uploads, so a run in your terminal can't spoil them.
Objectives
- After
./tidy.sh DIR, no name inDIRhas a space. - Nothing is lost: still 20 files, each with its contents.
- It writes
OLD -> NEWfor each file that it renames, and no line for a name with no space.