Need Help when compressing files by Linux RAR

Status
Not open for further replies.

shzzzzyyyy

Active Member
123
2011
8
5
I got many more files ***.avi and 1 website.url file.
I d like to pack all the avi files seperately with the url file.
eg. 1.avi + website.url ===> 1.rar
2.avi + website.url ===> 2.rar
3.avi + website.url ===> 3.rar

How can I do it automatically?

thx in advance
 
1 comment
Create a bash file called rarcreate in the folder where you keep avi files.
Code:
for file in *.avi
do
  i=${file%.*}
  rar a "$i" "$i.avi" website.url
done

Save it and change attributes to 777.

to run from ssh go to folder then type ./rarcreate
 
Last edited:
Status
Not open for further replies.
Back
Top