install
来自「查看系统硬件和内存资源使用情况;以及各个进程的使用情况」· 代码 · 共 70 行
TXT
70 行
#!/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 + =
减小字号Ctrl + -
显示快捷键?