📄 install
字号:
#!/bin/sh## this shell script is amazingly similar to the old and lamented# BSD "install" command. It recognized the following options:## -o target file owner# -m target file mode# -g target file group owner### scan the options#while [ $# -gt 0 ]; do case $1 in -o) owner=$2 shift ; shift ;; -m) mode=$2 shift; shift ;; -g) group=$2 shift ; shift ;; -*) echo "install: unknown option $1" exit ;; *) break ;; esacdone## we need two more: filename and destination#if [ $# -ne 2 ]; then echo "Usage: install [ -o owner ] [ -m mode ] [ -g group ] file destination" exitfi## first, copy#cp $1 $2## normalize the name#dest=$2if [ -d $2 ]; then dest=$2/`basename $1`fi## do optional things#if [ "$owner" ]; then chown $owner $destfiif [ "$group" ]; then chgrp $group $destfiif [ "$mode" ]; then chmod $mode $destfi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -