Sponsored Content
Full Discussion: fail on comparison
Top Forums Shell Programming and Scripting fail on comparison Post 302344223 by dr.house on Saturday 15th of August 2009 07:56:27 AM
Old 08-15-2009
Quote:
Originally Posted by bobprabhu
Code:
If [ $data1 = $data2 ]

Code:
if [ "$data1" = "$data2" ]

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Mail fail

I am using the shell script file to send mail by "mailx". I do this by cron job, there is no error found. But it is fail, any suggest to me? How can I resend it automatically? Is there any resend logic by using the mailx? (3 Replies)
Discussion started by: adela
3 Replies

2. Programming

Fail tail algorithm

I am currently working on code that simulates a file tail algorithm since the only way to retrieve the required information is from within a file, and this information needs to be retrieved in as close to real time as possible when the event enters the file. I cannot use system("tail <options>")... (6 Replies)
Discussion started by: foureightyeast
6 Replies

3. Shell Programming and Scripting

Rename fail

I've a lot of file with an hyphen on filename, so I use rename for remove him ad substitute with an underscore but it fails $ rename 's/\-/\_/' * Unknown option: _ Unknown option: i Unknown option: r Unknown option: e Unknown option: e Unknown option: _ Unknown option: g Unknown... (12 Replies)
Discussion started by: cv313x
12 Replies

4. AIX

en0 fail to up.

This is a LPAR that i created earlier. I want to set an IP address to en0 but it failed. Command: failed stdout: yes stderr: no Before command completion, additional instructions may appear below. en0 devdbm01 inet0 changed Method error (/usr/lib/methods/chgif): ... (8 Replies)
Discussion started by: wingcross
8 Replies

5. Red Hat

webmin login fail

Hi all, I got error, when i logged with webmin. please show me the way how can i login with webmin (4 Replies)
Discussion started by: mastansaheb
4 Replies

6. Shell Programming and Scripting

Why does my test fail ??

Hello, I am stuck... i dunno why does my test fail... any idea ? #!/bin/bash dos2unix info.txt Distor=Distributeur LINE=$(cat info.txt | sed -n 1p) echo $LINE echo $Distor echo "" echo "123-$LINE-123" echo "123-$Distor-123" if ; then LINE2=$(cat info.txt | sed -n 2p) echo $Distor... (14 Replies)
Discussion started by: patx
14 Replies

7. Linux

Telnet fail

Hi, I try to telnet to server: # telnet xx.xxx.1.72 1521 Trying xx.xxx.1.72... telnet: connect to address xx.xxx.1.72: Connection refused telnet: Unable to connect to remote host: Connection refused iptables is off: # service iptables status Firewall is stopped. # And I have edit... (4 Replies)
Discussion started by: mehrdad68
4 Replies

8. Red Hat

System fail to boot

Hi im using centos 6.4 starting yesterday i have a strange issue that im unable to resolve. the system is booting to GRUB menu and the os is not starting. i tried to run a repair install and the message attached is what i get, what can cause this? thanks, (1 Reply)
Discussion started by: guy3145
1 Replies

9. Shell Programming and Scripting

Untar fail

Hi Team, I have a file named as follows: aaa.tar.gz Now I need to verify if the untar fails, then the script has to send a mail. In order to check this condition, I need a tar.gz file which is unable to untar it. Can anyone help me to create a file which I will be able to unzip successfully... (2 Replies)
Discussion started by: kmanivan82
2 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Fail to register

After inputted all required fields in registration page, the below message is shown and cannot go on. A required field called Custom Date & Time Formats is missing or has an invalid value. (2 Replies)
Discussion started by: Unregistered
2 Replies
lsearch(3C)															       lsearch(3C)

NAME
lsearch(), lfind() - linear search and update SYNOPSIS
DESCRIPTION
is a linear search routine generalized from Knuth (6.1) Algorithm S. It returns a pointer into a table indicating where a datum may be found. If the datum does not occur, it is added at the end of the table. key Points to the datum to be sought in the table. base Points to the first element in the table. nelp Points to an integer containing the current number of elements in the table. The integer is incremented if the datum is added to the table. compar Name of the comparison function which the user must supply for example). It is called with two argu- ments that point to the elements being compared. The function must return zero if the elements are equal and non-zero otherwise. Same as except that if the datum is not found, it is not added to the table. Instead, a NULL pointer is returned. Notes The pointers to the key and the element at the base of the table should be of type pointer-to-element, and cast to type pointer-to-charac- ter. The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared. Although declared as type pointer-to-character, the value returned should be cast into type pointer-to-element. EXAMPLES
This code fragment reads in <= strings of length <= and stores them in a table, eliminating duplicates. ... ... RETURN VALUE
If the searched-for datum is found, both and return a pointer to it. Otherwise, returns NULL and returns a pointer to the newly added ele- ment. WARNINGS
Undefined results can occur if there is not enough room in the table to add a new item. SEE ALSO
bsearch(3C), hsearch(3C), tsearch(3C), thread_safety(5). STANDARDS CONFORMANCE
lsearch(3C)
All times are GMT -4. The time now is 02:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy