IF commands

From: Andrea Arquint (aarquint_at_hsw.fhz.ch)
Date: 06/25/04


Date: Fri, 25 Jun 2004 11:48:29 +0200

Hi

Id made a shell script like:

#!/bin/sh

MY_VAR=5

if [ $MY_VAR >= 3 ]; then
     cp /root/test.txt /tmp
fi

exit 0

#### End of shell script

This script example does not work??? Why

I don't know why but if I substitute the operator '>=' with '!=' than
the script works.

I don't know why that is... Must be a syntax error from the bash...

Thanks for help

Andrea



Relevant Pages

  • Error in shell encryption
    ... Whenever i run the encrypted shell script, i'm getting the below given error ... shcsample.sh.x: 1: Syntax error: "(" unexpected ... I want to protect my password details in shell script. ...
    (freebsd-questions)
  • Re: problems faced while using ssh
    ... expr: Syntax error ... grep: can't open month_midmonth_release.txt ... Does your shell script contain the full file path for the files that are ...
    (SSH)
  • Re: try... except SyntaxError: unexpected EOF while parsing
    ... | written it as shell script, but wanted to improve my python skills ... I'm not catching a syntax error as I'd like to. ... | port = input("Please enter a port to connect on. ...
    (comp.lang.python)
  • Re: BPF question
    ... After replacing Richard Tector with a small shell script on ... Prior to ... a syntax error on that line. ... devices required in the kernel configuration. ...
    (freebsd-stable)
  • Variable variable name
    ... but I am trying to do the following in a shell script: ... I get the following error message: ... combinetab.sh: line 17: syntax error near unexpected token `(' ... Isn't eval supposed to replace $type with AD and then put the contents of $file in an array names AD_10K? ...
    (comp.unix.shell)