2014-01-10 40 views
2

我想从文件列表创建tarfile。
文件列表有两行从IBM i上的压缩档中的文件列表中存储文件 - shell

log1.dat 
log2.dat 

shell脚本的样子:

cd /temp/temp1 
tar -cvf test.tar -L inp.txt 

所有文件都存储在目录temp/temp1。 的QSHELL抛出一个错误:

no file or directory with the name inp.txt 

但该文件是存在的,inp.txt命名。

test.tar已创建,inp.txt存储在存档中。 我不想把inp.txt放在tarball中 - 我想存储inp.txt中列出的文件。

怎么回事?

回答

4

只有PASEtar实用程序接受[ -L InputList ]作为参数。

Usage: tar -{c|r|t|u|x} [ -BdDEFhilmopRUsvw ] [ -Number ] [ -f TarFile ]    
     [ -b Blocks ] [ -S [ Feet ] | [ [email protected] ] | [ Blocksb ] ]   
     [ -L InputList ] [-X ExcludeFile] [ -N Blocks ] [ -C Directory ] File ... 

Usage: tar {c|r|t|u|x} [ bBdDEfFhilLXmNopRsSUvw[0-9] ] ]        
     [ Blocks ] [ TarFile ] [ InputList ] [ ExcludeFile ]      
     [ [ Feet ] | [ [email protected] ] | [ Blocksb ] ] [-C Directory ] File ... 

限定路径工具来使用PASE版本:

/qopensys/usr/bin/tar -cvf test.tar -L inp.txt 
+0

非常感谢您!而已。 – user1121575

相关问题