开发者

Using bash to get the files rar creates

开发者 https://www.devze.com 2023-01-25 16:04 出处:网络
I\'m running the command rar a -m0 -v100m rarname.rar *.* On some files with a bash script. I know I specified the rarname, but because of the -v option which sets a size limit to the rar, this com

I'm running the command

rar a -m0 -v100m rarname.rar *.*

On some files with a bash script. I know I specified the rarname, but because of the -v option which sets a size limit to the rar, this command can make lots of rars named rarname.part1.rar开发者_Go百科, rarname.part2.rar, etc.

What is the best way to get the list of files created?


This should do it:

rarname.*.rar

Globs are not limited to the DOS-style "name.ext" pattern.


You can either capture and parse the output from the rar command or create the rar'ed files in a temporary directory, and then process the files there.

I'd recommend the later option.

0

精彩评论

暂无评论...
验证码 换一张
取 消