由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - confused by some shell scripts run on mac (转载)
相关主题
Invalid ELF header Re: 问一个shell script的问题which shell is best?
why cannot run a binary program in csh?DD weijing!
sun SPARCstation 20 questionshell programming
怎么在FTP里改变文件属性?有关Unix shell script的问题
[转载] Pthread Multiprogrammingwhere can I find some good website for C Shell ?
请system programming的高手给看看,Shell Script
[转载] 请教一个关于ln的问题问一个Unix Shell Script 的问题
Re: Bash一问:怎么includeCGI之Perl Script一问
相关话题的讨论汇总
话题: mymac话题: invalid话题: mac话题: me话题: scripts
进入Unix版参与讨论
1 (共1页)
m*****k
发帖数: 731
1
【 以下文字转载自 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?
1 (共1页)
进入Unix版参与讨论
相关主题
CGI之Perl Script一问[转载] Pthread Multiprogramming
help on sed请system programming的高手给看看,
segmentation fault when using "script"[转载] 请教一个关于ln的问题
[转载] Perl高手请进Re: Bash一问:怎么include
Invalid ELF header Re: 问一个shell script的问题which shell is best?
why cannot run a binary program in csh?DD weijing!
sun SPARCstation 20 questionshell programming
怎么在FTP里改变文件属性?有关Unix shell script的问题
相关话题的讨论汇总
话题: mymac话题: invalid话题: mac话题: me话题: scripts