📄 qu-14-01_lspids.sh
字号:
#!/bin/sh# Chapter 15 - Answer to Question 1# This function prints out the pid for the named process# On linux/bsd you will need to change the value of $PSCMD# to:## PSCMD="/bin/ps -auwx"## You will need to "source" this script into your environment# using the . command.lspids() { USAGE="Usage: lspids [-h] process" HEADER=false PSCMD="/bin/ps -ef" case "$1" in -h) HEADER=true ; shift ;; esac if [ -z "$1" ] ; then echo $USAGE ; return 1 ; fi if [ "$HEADER" = "true" ] ; then $PSCMD 2> /dev/null | head -衝 1 ; fi $PSCMD 2> /dev/null | grep "$1"| grep -v grep}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -