maketgz

来自「邮件发送后向相应手机发送短信」· 代码 · 共 56 行

TXT
56
字号
#! /bin/sh# Script to build release-archives with#echo "Version number?"read versionHEADER="main.h"# Replace version number in header file:sed 's/#define VERSION.*/#define VERSION "'$version'"/g' $HEADER >$HEADER.new# Save old header filecp -p $HEADER $HEADER.old# Make new header:mv $HEADER.new $HEADER# get current dirdir=`pwd`# Get basenameorig=`basename $dir`# Get the left part of the dash (-)new=`echo $orig | cut -d- -f1`# Build new directory namen=$new-$version;# Tell the world what we're doingecho "creates $n.tar.gz";if [ -r $n ]; then  echo "Directory already exists!"  exitfi# Create the new dirmkdir $n# Copy all relevant files, with path and permissions!tar -cf - `cat FILES` | (cd $n; tar -xBpf -)# Make a tar archive of it alltar -cvf $n.tar $n# gzip the archivegzip $n.tar# Make it world readablechmod a+r $n.tar.gz ;# Delete the temp dirrm -rf $n

⌨️ 快捷键说明

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