我想从文件列表创建一个tarfile。
文件列表有两行

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.

出了什么问题?

有帮助吗?

解决方案

只有 [医]普斯 tar 公用事业接受 [ -L InputList ] 作为参数。

Usage: tar -{c|r|t|u|x} [ -BdDEFhilmopRUsvw ] [ -Number ] [ -f TarFile ]            
         [ -b Blocks ] [ -S [ Feet ] | [ Feet@Density ] | [ 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 ] | [ Feet@Density ] | [ Blocksb ] ] [-C Directory ] File ...   

限定实用程序的路径以使用PASE版本:

/qopensys/usr/bin/tar -cvf test.tar -L inp.txt
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top