我有一个问题。我想直接从文件解压缩字符串。我有一个脚本在bash中创建另一个脚本。Gunzip from字符串
#!/bin/bash
echo -n '#!/bin/bash
' > test.sh #generate header for interpreter
echo -n "echo '" >> test.sh #print echo to file
echo -n "My name is Daniel" | gzip -f >> test.sh #print encoded by gzip string into a file
echo -n "' | gunzip;" >> test.sh #print reverse commands for decode into a file
chmod a+x test.sh #make file executable
我想生成脚本test.sh这将是最短的脚本。我试图压缩字符串“我的名字是丹尼尔”,并直接写入文件test.sh
但是,如果我运行test.sh我得到gzip:stdin有标志0x81 - 不支持 你知道为什么我有这个问题吗?