So far I have the following code:
#!/bin/bash
echo "Adding new path...."
if [[$# -eq1] || [$# -eq2]]
then
if [$# -eq2]
then
export PATH=$PATH:/$1:/$2
fi
if [$# -eq1]
then
export PATH=$PATH:/$1
fi
else echo "Incorrect number of parameters. No more than two directories can be added at once."
fi
echo $PATH
exit 0
When I run this script passing it one parameter i get an error: "./addDir: line 3: [[1: command not found ./addDir: line 3: [1: command not found "
when I run it with 2 parameters instead of "1" it says "2"
What's going on?