📄 mktar.sh
字号:
#!/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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -