#!/bin/bash
echo "Please enter your desired file type(s) from the following list
gif jpg docx
any other value than these three is also valid"
read entry1 entry2 entry3 entry4
echo your first choice was: $entry1
echo your second choice was: $entry2
echo your third choice was: $entry3
echo your fourth choice was: $entry4
if [$entry1 || $entry2 || $entry3 || $entry4 =="jpg"]
then
mkdir jpg
echo "jpg directory created"
fi
What I am trying to do is, create a directory whenever a chosen value is entered. If jpg, gif or docx is typed: a directory is created for jpg, gif or docx as appropriate. At present, no matter what I enter into my code, I am ALWAYS creating a jpg directory.....even when I enter jpg, gif, docx or some utterly random value such as tinzebra.
My understanding was that the statement after the THEN was contingent upon the statement being true/false as the case maybe, but it would appear that my code is interpreting the Boolean as always true....which is confusing me immensely