New to bash here. I am trying to pass a read input to a filepath for a cat
command.
read -p "enter folder" folderid
read -p "enter port (optional)if not required press 0:" port
if [$folderid -ne 0 && $port -ne 0];then
new_interface=$(cat /var/abc/def/xyz_$fileid/randomfile)
echo "$new_interface"
fi
Sample input for folderid: 134567
I get an error stating:
-bash: [134567: command not found
Not sure what am I doing wrong, tried different things nothing seems to work.