|
这是从网上找的一个旋转字符的脚本,我试了一下但报错,初学看不很懂这个报错提示。
#!/bin/bash
stardict&
id=$!
char=("-" "/" "|" "\\")
n=0
while ps -ax | grep "^[[:space:]]*$id" >/dev/null
do
echo -ne "\rWaiting ... ${char[$n]}"
n=$(((n+1)%4))
sleep 1
done
echo OK
这是在终端下的输出
$ ./rotate.sh
Warning: bad syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
Waiting ... -bookname: XDICT汉英辞典 , wordcount 160997
bookname: 牛津现代英汉双解词典 , wordcount 39429
bookname: CEDICT?英?典 , wordcount 25230
bookname: 朗道汉英字典5.0 , wordcount 405719
bookname: 朗道英汉字典5.0 , wordcount 435468
bookname: CDICT5英汉辞典 , wordcount 57510
Audio device open for 44.1Khz, stereo, 16bit failed
Trying 44.1Khz, 8bit stereo.
Audio device open for 44.1Khz, stereo, 8bit failed
Trying 48Khz, 16bit stereo.
Warning: bad syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
Waiting ... /Warning: bad syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
Waiting ... |Warning: bad syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
Waiting ... \Warning: bad syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
OK |
|