简体   繁体   中英

How to pass parameters to sh file with php?

I'm executing this command:

exec('sh myFile.sh paramater1')

But in myFile.sh , how to get parameter1 ?

I didn't find any information about it

The command line parameters in shell are referenced as $1 , $2 , and so forth.

As a side note:

  • $0 is the name of the command
  • $# is the total number of parameters
  • $@ is all of the parameters

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM