Hi guys,
I have this piece of code here:
Code:
#!/bin/bash
# zipit.sh
folder=$1
zip -rm ${folder}.zip $folder
mv -t ../done ${folder}.zip
What happens is that I will be doing that over and over again for a few days so I decided to create a little script for it but I dont know if you could guess it... it creates a small problem...
when I do
zipit M[TAB] to auto complete the auto complete adds a "/" at the end of the folder name, and what the script does is that it creates a file named ".zip" with the contents inside...
The question is, how can i assign
folder=$1 but deleting the "/"... or perhaps a more correct variable expansion in
${folder}.zip would help? but im not sure about it since im little new in bash scripting.
Any other suggestions are appreciated.