Re: [SLUG] Bash Help Needed

From: Ron Youvan (ka4inm@tampabay.rr.com)
Date: Sat May 17 2008 - 13:31:23 EDT


> printf "argument= %s\n" "$1" #works correctly

> if [$1 -eq ""]; then
> cnt=10
> printf "$1 is blank\n" "$cnt"
> else
> printf "$1 is not blank\n" "$cnt"
> cnt=$1
> fi

> printf "cnt=%s\n" $cnt

> Error:
> If there is no argument I get this message: line 9: -eq: command not found
> If there is an argument of 15: line 9: 15: command not found

> Anyone have any idea what I am doing wrong? line 9 is the 'if' statement

#!/bin/bash
# /usr/local/bin/bed
# by Ron KA4INM Youvan
if

   Here my "if" is on line #4, is that right?
if there is no command -eq you may need to put -e -q

  My "bash" book is for version 2.0 so it is out of date.

-- 
    Ron  KA4INM - The harder I work, the behinder I get!
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:51:03 EDT