LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2007, 07:48 PM   #1
Elendrael
LQ Newbie
 
Registered: Sep 2007
Posts: 11

Rep: Reputation: 0
EASY scripting question - trying to figure out a test statement


Hey guys
This is an easy question - but i'm stuck.
I have my whole script working except for one little test command.
what i have is

if [$add -eq[*][=][*]]
then bblah blah

im trying to test a variable input by the user which has to be in the form VARIABLE=value. So $add is the variable i want tested and the[*][=][*] part is how i thought i could test it.

does anyone know how i can test this - ive searched through two massive text books and the internet and just can't get an answer. Its frustrating coz i know it is easy

im working on bourne shell
 
Old 09-16-2007, 07:52 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,441

Rep: Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791
Wouldn't it be easier to just prompt for the value & check that? You know which var you are prompting for.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Defence statement released in Israeli GPL test LXer Syndicated Linux News 0 04-03-2007 03:31 PM
Case Statement With Aix Ksh Scripting ']['HeBroken AIX 2 02-09-2005 12:44 PM
KSH Scripting case statement..... ']['HeBroken Programming 1 12-10-2004 10:38 AM
Another easy Bourne Shell Scripting question WinterSt Programming 7 09-02-2004 07:41 PM
Really easy but can't figure it out jakublgz Linux - General 4 09-29-2002 11:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration