m*k
2 楼
【 以下文字转载自 Apple 讨论区 】
发信人: madmonk (madmonk), 信区: Apple
标 题: confused by some shell scripts run on mac
发信站: BBS 未名空间站 (Thu Mar 1 20:54:43 2012, 美东)
my.sh file is like this:
#!/bin/bash
while getopts ":a" opt; do
case $opt in
a) echo "-a was triggered!";;
\?) echo "Invalid option: -$OPTARG" ;;
esac
done
but when I ran it several times, I got diff answers:
mymac me$ . my.sh -abc
-a was triggered!
Invalid option: -b
Invalid option: -c
mymac me$ . my.sh -abc
mymac me$ . my.sh -abc
mymac me$
any mac *nix guy can help explain why it behaves like this?
发信人: madmonk (madmonk), 信区: Apple
标 题: confused by some shell scripts run on mac
发信站: BBS 未名空间站 (Thu Mar 1 20:54:43 2012, 美东)
my.sh file is like this:
#!/bin/bash
while getopts ":a" opt; do
case $opt in
a) echo "-a was triggered!";;
\?) echo "Invalid option: -$OPTARG" ;;
esac
done
but when I ran it several times, I got diff answers:
mymac me$ . my.sh -abc
-a was triggered!
Invalid option: -b
Invalid option: -c
mymac me$ . my.sh -abc
mymac me$ . my.sh -abc
mymac me$
any mac *nix guy can help explain why it behaves like this?
a*a
3 楼
PIA黄瓜进行时
P*r
4 楼
我没有啊,我这小农村,物质贫乏啊,只能眼泪汪汪的看着大家吃又脆又多水的中国黄
瓜,我只能望着我的美国黄瓜苗暗自伤神啊
瓜,我只能望着我的美国黄瓜苗暗自伤神啊
B*8
5 楼
支持!
相关阅读
FreeBSD & maxtor 20G HD[转载] How to set up counters on Pentium 4?[转载] logrotatefirewall for SUN Solaris 2.6?Re: how to automatically send email with attachments in Perl?PATH Problem?怎么改系统时间?[转载] SIGTSTP[转载] ask a simple question. pls help.an unixquestions, Please help!Solaris上有什么DVD-RW可用questionHow to set the titile of the terminal?能这样么?[转载] 求教:如何把自己的头文件目录加到系统默认的路径里?[转载] 如何access Xwindow 的 clipboard, 编程须要请问x-win32下的字体能调大一点么?谢谢!(none)How to find out if a file is older than 5 mins in a shell script[转载] using ssh in tcsh script系统无法登录!