Ketika saya mencoba menjalankan perintah di bawah ini di Ubuntu:
sudo -n -u contd sh --login -c ". /home/contd/iib-10.0.0.5/server/bin/mqsiprofile;/home/contd/iib-10.0.0.5/common/jdk/jre/bin/java -cp $CLASSPATH:$MQSI_JREPATH//usr/share/ant/lib/ant-antlr.jar:/usr/share/ant/lib/ant-apache-bcel.jar:/usr/share/ant/lib/ant-apache-bsf.jar:/usr/share/ant/lib/ant-apache-log4j.jar:/usr/share/ant/lib/ant-apache-oro.jar:/usr/share/ant/lib/ant-apache-regexp.jar:/usr/share/ant/lib/ant-apache-resolver.jar:/usr/share/ant/lib/ant-apache-xalan2.jar:/usr/share/ant/lib/ant-commons-logging.jar:/usr/share/ant/lib/ant-commons-net.jar:/usr/share/ant/lib/ant-javamail.jar:/usr/share/ant/lib/ant-jdepend.jar:/usr/share/ant/lib/ant-jmf.jar:/usr/share/ant/lib/ant-jsch.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant-junit4.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-swing.jar:/usr/share/ant/lib/ant-testutil.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/jsch.jar:/usr/share/ant/lib/junit.jar -Djava.ext.dirs=/home/contd/iib-10.0.0.5/common/jdk/lib:/home/contd/iib-10.0.0.5/common/jdk/jre/lib/ext -Dant.home=/usr/share/ant org.apache.tools.ant.Main -f /home/contd/AntScript/build_main.xml"
Saya mendapatkan kesalahan ini:
sh: 0: Illegal option --
Perintah di atas seharusnya didukung di Linux, tetapi ketika saya mencoba menerapkan solusi yang sama (Ant scripting) di Ubuntu, saya menghadapi masalah ini.
Perbaikan cepat akan diganti
—
Seth
--login
dengan adil -l
.
dash
shell mendukung--login
opsi bentuk panjang : lihat DashAsBinSh