Quote:
Originally Posted by burninGpi
Shell script:
Code:
#!/bin/sh
for file in *.jpg
do
mv "$file" "wa$file"
done
|
What would the login look like if I already had files that had "wa" appended to them and some of them without and I only want to change the filename that do not have "wa". Also, it would do the same for both jpeg and jpg files. For instance:
cat.jpg
wadog.jpg
bird.jpg
wafish.jpg
So, I guess I want this in pseudocode:
for every file that has the extension "jpg" or "jpeg"
if file does not already have "wa" in front of file