ต้องการให้มันรวมๆกันที่เดียว
เลยเขียนสคริปต์ทำงานดีกว่า เพราะไฟล์มันก็ตั้ง 400 กว่าตัว ต้องการให้ zip ใคร rar ใครก็ลงไปที่ folder ของตัวเองด้วย
ถ้าเป็น rar file เราสามารถ extract โดย
unrar x filerar.rar folderrar
ถ้าเป็น zip file เราสามารถ unzip โดย
unzip filezip.zip -d folderzip
และนี่เป็น ตย ตัวอย่าง
#!/bin/csh -f
set dir = "g:/tba/"
set allfile = `ls $dir`
set echo
set i = 1
cd $dir
foreach path ($allfile)
echo $i - $path
set name = `echo $path | c:/usr/local/bin/cut -d. -f1`
set ext = `echo $path | c:/usr/local/bin/cut -d. -f2`
if ($ext == "rar") then
c:/progra~1/winrar/unrar x $path $name
else if ($ext == "zip") then
c:/bin/unzip $path -d $name
endif
echo $name and $ext
@ i ++
end