How do you read arguments in a shell program - $1, $2 ..?
Answer Posted / seshadri sethi
Shell script accepts parameters in following format…
$1 would be the first command line argument, $2 the second,
and so on
$0 is the name of the script or function
If your script has more than 9 params then accept in
following way…
${12} : 12th param
${18} : 18th param
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Is scripting and coding the same thing?
What does echo mean in scripting?
What is shell scripting?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
Please give me example of " at command , contrab command " how to use
What is an sh file?
What is path variable bash?
How to replace following lines, catch (DAOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } catch (BOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw e; } catch (Exception e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } Needs to be changed in to, catch (DAOException e) { AppException.handleException (null, null, e, null, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); } catch (BOException e) { AppException.handleException (null, null, null, e, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 0); } catch (Exception e) { AppException.handleException (null, null, null, null, null, e, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); }
What is awk in shell script?
How to find duplicate record in file using shell script?
What is a shell environment?
How do I run a script from command prompt?
What is difference between bash and shell?
How to print all array elements and their respective indexes?
Is shell scripting a language?