I’m having a hard time figuring out how to do this if statement. I want to do this:
IF (the function has only 1 argument
AND $1 is a directory (in the current
folder)) OR IF (the function has 2
arguments AND $1 is NOT a directory ) THEN....END
Sorry if it’s not very clear,
Thanks in advance
You pretty much said what is needed in the question:
You can use other operators too – that will work in Bourne shell, let alone Korn or other POSIX shells (assuming that $# works correctly in a function – which it does in Bash).