Sponsored Content
Top Forums UNIX for Dummies Questions & Answers If variable equals string help Post 302931617 by RudiC on Wednesday 14th of January 2015 07:14:41 AM
Old 01-14-2015
Would have been wise to post the error msg as well, so we don't have to guess... My guess is, if sees too many words in the first operand. Try quoting the variable.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

only if column1 equals this print that

I have text file with hundreds of lines, space delimited, each line has the same amount of "columns" and the same amount of characters in each, Column 1, Column 2, and Column 3. I need a script that will print all columns of the "current" line along with the last two columns of the next line ONLY... (3 Replies)
Discussion started by: ajp7701
3 Replies

2. Shell Programming and Scripting

How TO: if [ Not Equals ] - Solaris 8

Hi, I have the following script which runs well :- ls -l /etc/*.txt > /dev/null 2>&1 if ; then "Success" fi But, if I try, if ; then "Success" fi Does not works ! Even, (4 Replies)
Discussion started by: angshuman_ag
4 Replies

3. Shell Programming and Scripting

Compare 3 files, delete data equals.

Hi, i have a problem, I have three files, file_1, File_2 file_3 and I need to compare the data with file_3 file_1, data that are equal to file_3 file_1 should be deleted, file_1 receive data and file_2 file_3. Ex: file_1 374905,2001, Selmar Santos, Técnico de Sistemas, U$3.000,00 789502,... (3 Replies)
Discussion started by: selmar
3 Replies

4. Shell Programming and Scripting

replace (sed?) a string in file with multiple lines (string) from variable

Can someone tell me how I can do this? e.g: a=$(echo -e wert trewt ertert ertert ertert erttert erterte rterter tertertert ert) How do i replace the STRING with $a? I try this: sed -i 's/STRING/'"$a"'/g' filename.ext but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies

5. Shell Programming and Scripting

How to output the partially equals

Hello i have 2 files: a.out 10.1.1.1 james.franco 10.1.1.3 google.gol 10.1.1.14 yahoo.bol b.out 10.1.1.1 10.1.1.3 10.1.1.45 I need to see an output just with: 10.1.1.1 james.franco 10.1.1.3 google.gol Thankz in advance!! (2 Replies)
Discussion started by: danielldf
2 Replies

6. Shell Programming and Scripting

[solved] how to check if two arrays are equals?

how to compare to arrays to check if each elements of the first are the same of the second? for ((i=0;i<$LENGTH;i++)) ; do for (j=0;j<$LENGTH;j++)) ; do if } == ${ARR2} ] echo "Are the same"; fi; done; done; i try this but it doesn't work :( if i make... (0 Replies)
Discussion started by: tafazzi87
0 Replies

7. UNIX for Dummies Questions & Answers

Comparing a String variable with a string literal in a Debian shell script

Hi All, I am trying to to compare a string variable with a string literal inside a loop but keep getting the ./testifstructure.sh: line 6: #!/bin/sh BOOK_LIST="BOOK1 BOOK2" for BOOK in ${BOOK_LIST} do if then echo '1' else echo '2' fi done Please use next... (1 Reply)
Discussion started by: daveu7
1 Replies

8. UNIX for Dummies Questions & Answers

awk if statement / equals operator

Hi, I was hoping someone could explain this please :) I'm using bash, scientific linux... and I don't know what else you need to know. With awk '{ if( 0.3 == 0.1*3) print $1}' file.dat nothing will be printed since apparently the two numbers do not equate. (Using 0.3 != 0.1*3 is seen... (4 Replies)
Discussion started by: Golpette
4 Replies

9. Shell Programming and Scripting

Until string from remote command equals value run remote command

I solved my issue by using the following code #!/bin/bash function GET_STATUS { #values Active Passive Failed ssh -a localhost '/home/user/fakecommand.sh' } STATE="unknown" until ] do echo $STATE sleep 5 STATUS=`GET_STATUS` echo $STATUS | grep Active &&... (1 Reply)
Discussion started by: $scipt_Kid
1 Replies

10. UNIX for Beginners Questions & Answers

Check if string variable is a subset of another string variable

Below is my ksh shell script where I need to check if variable fileprops is a subset of $1 argument. echo "FILE PROPERTY: $fileprops" echo "PARAMETER3: $1" if ; then echo "We are Good. $line FILE is found to be INTACT !! " else echo... (2 Replies)
Discussion started by: mohtashims
2 Replies
XmDirectionMatch(library call)											    XmDirectionMatch(library call)

NAME
XmDirectionMatch -- A function that checks for a specified direction component SYNOPSIS
#include <Xm/Xm.h> Boolean XmDirectionMatch (d1, d2) XmDirection d1; XmDirection d2; (void) DESCRIPTION
XmDirectionMatch compares two XmDirection values. The function returns a Boolean value depending on whether or not the two input values "match." The simplest match is when d1 and d2 are identical. However, other matches are possible. XmDirectionMatch attempts to compare specified bits only; nonspecified bits automatically match. For example, suppose that d1 equals XmTOP_TO_BOTTOM_RIGHT_TO_LEFT. In this case, the function will return True if d2 equals either XmRIGHT_TO_LEFT or XmTOP_TO_BOTTOM. However, the function will return False if d2 equals XmTOP_TO_BOTTOM_LEFT_TO_RIGHT, XmBOT- TOM_TO_TOP_RIGHT_TO_LEFT, or XmBOTTOM_TO_TOP_LEFT_TO_RIGHT. Note that direction can be thought of as having three components, a horizontal component, a vertical component, and the precedence among them. This means that in addition to the previously mentioned directions, the function will still return False if d1 equals XmTOP_TO_BOT- TOM_RIGHT_TO_LEFT and d2 equals XmRIGHT_TO_LEFT_TOP_TO_BOTTOM. d1 Specifies an XmDirection value. d2 Specifies an XmDirection value. RETURN VALUES
Returns True if d1 "matches" d2; otherwise, returns False. RELATED INFORMATION
XmDirection(3), XmDirectionMatchPartial(3), XmDirectionToStringDirection(3), XmString(3), XmStringDirection(3), and XmStringDirectionToDi- rection(3). XmDirectionMatch(library call)
All times are GMT -4. The time now is 07:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy