Imran Ahmed Imran Ahmed - 2 years ago 96
Bash Question

Provide empty value to an argument in linux command

I have a shell script where I can pass two arguments.

1st argument can be empty or a string
2nd argument can be 0 or 1

Now I want to provide empty value to first argument and 1 to 2nd, how could I call it?

mycommand ___ 1

what should be the value at __

Answer Source

You can just pass an empty string as the first argument:

mycommand '' 1
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download