I am working on function that will resize and optimize all images in the directory with single command.
So far I created this function
function prepareimages() {
# Resize Images
for img in *.jpg; do
convert -resize $1\! "$img" "$img"
done
# Optimize Images
jpegoptim *.jpg
}
The idea is that I can use
prepareimages("400x300")
Then I tried to save the alias in .bashrc file, but dont know how to save it
I know you can save normal commands like
alias home="ssh root@123.11.11.11"
But is there way to save function as alias ?
alias prepareimages = prepareimages();
This doesnt work.