Pass few arguments

Here is the problem
1
2
3
4
5
6
7
8
9
10
# Enter arguments : -P -L -A
read first
# //example coding

# if [ "$first" != "-P" && "$first" != "-L" && "$first" != "-A" ]
    then
        echo "GOOD"
    else 
        echo "BAD"
fi


how i compare that in my variable contain only
-P -L or -A
this is a c++ forum.
Please try:

1
2
3
4
5
6
7
8
9
10
# Enter arguments : -P -L -A
read first
# //example coding

if [[ "$first" != "-P" && "$first" != "-L" && "$first" != "-A" ]]
    then
        echo "GOOD"
    else 
        echo "BAD"
fi


Hope this helps.
sorry. post wrong topic ..
Topic archived. No new replies allowed.