mktar.sh

来自「The soruce code of simple SMTP client fo」· Shell 代码 · 共 47 行

SH
47
字号
#!/bin/sh## create a gzip compressed tar archive of the current working directory.# the name of the file will be dir.tar.gz#. ./VERSIONpwd=`pwd`pwd_head=`basename $pwd`## first check if we'r at the corrent directory#if [ $pwd_head != $SLL_VERSION ]; then    echo "You are in wrong base directory"    echo "Expected: $SLL_VERSION"    echo "Found:    $pwd_head"    echo "exiting ..."    exit 1fitar_filename=$pwd_head.tar## remove the tar file if any in the current working directoyr#if [ -f ./$tar_filename.gz ]; then    echo "removing $tar_filename.gz"    rm -f ./$tar_filename.gzfimake clean > /dev/null 2>&1## go up#cd ..tar -cf /tmp/$tar_filename ./$pwd_headif [ $? -eq 0 ]; then    gzip -f -v -9 /tmp/$tar_filename    mv /tmp/$tar_filename.gz ./$pwd_head    cd $pwd    ls -l $tar_filename.gzfi

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?