shell - script with simple flag -


मान लीजिए मेरे पास यह सरल स्क्रिप्ट है

  #! / Bin / sh अगर [$ # -ए 2 2] तब "उपयोग: $ 0 arg1 arg2" से बाहर निकलें 1 फाई शीर्ष $ 1 $ 2 # # लेकिन यह माना जाता है: ## अगर -f फ्लैग सेट है, ## कॉल [पूंछ $ 1 $ 2] ## और यदि झंडा सेट नहीं है ## कॉल [हेड $ 1 $ 2]   

तो मेरी स्क्रिप्ट में 'फ्लैग' की जांच करने का सबसे सरल तरीका क्या है?

धन्यवाद

  एफएलएलएल = no " $ एआरजी "= -एफ एंड amp; "$ एफएलएलएजी" = हाँ टेस्ट "$ 1" "$ 2" और सिर "$ 1" "$ 2" फाई   

यह आसान तरीका भी व्यवहार्य हो सकता है:

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -