I would like to execute a script(h.ksh) with the passing argument kim (which is a folder),

so when I run the command

 h.ksh kim

the folder "kim" will be used as a variable in the h.ksh

Do I need to use the option function?

  • Command line args are placed into $1, $2, etc. So in your example $1 has the value kim. – kaylum Jan 22 '20 at 2:56
  • I inserted argument="$1" and printf "$argument" into the script file so the $agrument will contain the folder name. Is this right? – user234568 Jan 22 '20 at 3:03