Very Simple BASH Question with Conditional Expressions

Posted on 2005-03-23
Medium Priority
Last Modified: 2010-04-21
I just want to do a logical OR.
This line gives me errors:

if [ ("$v" != "") || ("$c" != "") ]; then

I get this error:
./dcmget: line 71: syntax error near unexpected token `"$v"'
./dcmget: line 71: `        if [ ("$v" != "") || ("$c" != "") ]; then'

I have tried a few variations but nothing seems to work.

Question by:dignified
1 Comment
LVL 29

Accepted Solution

MikeOM_DBA earned 200 total points
ID: 13616228
Try this:

if [[ "$v" != "" || "$c" != "" ]]; then


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question