LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 08: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, 08:52 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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 04:31 PM
Case Statement With Aix Ksh Scripting ']['HeBroken AIX 2 02-09-2005 01:44 PM
KSH Scripting case statement..... ']['HeBroken Programming 1 12-10-2004 11:38 AM
Another easy Bourne Shell Scripting question WinterSt Programming 7 09-02-2004 08:41 PM
Really easy but can't figure it out jakublgz Linux - General 4 09-30-2002 12:52 AM


All times are GMT -5. The time now is 09:10 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration