小编Shr*_*are的帖子

以下脚本中的脚本 2>/dev/null 有什么用?

$!/bin/sh
if grep "$1" /etc/passwd 2>/dev/null               #Search username at beging of line1
then
         echo "Pattern found - Job Over"
else 
         echo "Pattern not found"

fi
Run Code Online (Sandbox Code Playgroud)

grep scripting io-redirection control-flow

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

control-flow ×1

grep ×1

io-redirection ×1

scripting ×1