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 楼
支持!
相关阅读
有人在Linux用过/usr/bin/time 测peak memory usage么?ultraedit for linux有了?怎么给一个txt里面的email address发邮件?2013年中国Qt开发者大会 | 请预留这个日期 (转载)cygwin是干什么的AIX的IP Security怎么做?安装好solaris后显卡如何装请问一个sever 问题 (转载)sun blade 1000的硬盘拔出来,再插回去,然后就起不来了公司处理一批服务器求教:奇怪的应用程序crash (转载)菜鸟请教什么类型的项目需要unix下面的编程launcher找不到了求教,学shell programbad pbr sig如何合并两个数据文件TCSH里怎么用setenv把一个带有空格的路径加给$PATH?shell问题请教关于 unix sed 命令的疑问 (转载)下个月就要回国了,低价甩卖所有带不回去的家电家具