I want to compress the contents of stdin using zip
, for instance:
我想使用zip来压缩stdin的内容,例如:
echo 'foo bar' | zip > file.zip
This works ok, but when unzipping, the uncompressed file name is -
这工作正常,但解压缩时,未压缩的文件名是 -
I was wondering how I could specify a file name for stdin?
我想知道如何为stdin指定文件名?
1 个解决方案
#1
-5
echo 'foo bar' | zip -@ /path/to/zipfile.zip
should do it while keeping filename integrity
echo'foo bar'| zip - @ /path/to/zipfile.zip应该保持文件名完整性
#1
-5
echo 'foo bar' | zip -@ /path/to/zipfile.zip
should do it while keeping filename integrity
echo'foo bar'| zip - @ /path/to/zipfile.zip应该保持文件名完整性