我看過這篇文章:sed delete remaining characters in line except first 5它幫助我刪除x後的所有字符。但是,我很難找到如何刪除x字符後的所有單詞。 我開始使用此代碼: echo "StackOverflow Users Are Brilliant And Hard Working" | sed 's/.//30g'
#character 30 -
我正在使用AIX 6.1。下面的代碼對我來說工作得很好。 if [ "$HOSTNAME" = "host1" ]; then
echo "This is host1"
elif [ "$HOSTNAME" = "host2" ]; then
echo "This is host2"
else
echo "This is another host"
fi
但