Sponsored Content
Full Discussion: comparing two strings
Top Forums Shell Programming and Scripting comparing two strings Post 302089776 by ragha81 on Wednesday 20th of September 2006 06:04:47 PM
Old 09-20-2006
i did a set -x.. this is the output I get

Code:
 + read SV_NAME CC_NAME CP_DISP_RUN_STATE
+ echo sble01
sble01
+ echo ALLTEL - WebOrders WorkMon Shutting
ALLTEL - WebOrders WorkMon Shutting
+ echo down
down
+ [ ALLTEL - WebOrders WorkMon != ALLTEL - WebOrders WorkActn ]
+ [ down != Running ]
+ echo success
success
+ read SV_NAME CC_NAME CP_DISP_RUN_STATE
+ echo

+ echo
+ echo

+ [ ALLTEL - WebOrders WorkMon != ALLTEL - WebOrders WorkActn ]
+ [  != Running ]
+ echo success
success
+ read SV_NAME CC_NAME CP_DISP_RUN_STATE
+ (( i=i+1 ))
+ [ 1 -eq 2 ]
+ /siebel/sble01/siebsrvr/bin/srvrmgr -g lfs6217q.alltel.com -e esble -s sble01 -u n9912499 -p n9912499 -c list component 'ALLTEL WorkMon24Hrs' show SV_NAME, CC_NAME, CP_DISP_RUN_STATE -o /siebel/sble01/siebfile/batch//WorkflowMon/log/temp_20060920_170358.out
+ sed -n /^SV_NAME/,$ p
+ 0< /siebel/sble01/siebfile/batch//WorkflowMon/log/temp_20060920_170358.out
+ sed /rows* returned/,$ d
+ awk
NR > 2 {n = split($0,arr," ")
printf("%s|",arr[1])
for( k = 2; k <=n-1;++k) printf("%s ",arr[k])
printf("\b|%s\n",arr[n]) }
+ 1> temp
+ old_IFS=|
+ IFS=|
+ set -x
+ 0< temp
+ read SV_NAME CC_NAME CP_DISP_RUN_STATE
+ echo sble01
sble01
+ echo ALLTEL WorkMon24Hrs
ALLTEL WorkMon24Hrs
+ echo Running
Running
+ [ ALLTEL WorkMon24Hrs != ALLTEL - WebOrders WorkActn ]
+ [ Running != Running ]
+ read SV_NAME CC_NAME CP_DISP_RUN_STATE
+ echo

+ echo
+ echo

+ [ ALLTEL WorkMon24Hrs != ALLTEL - WebOrders WorkActn ]
+ [  != Running ]
+ echo success
success
+ read SV_NAME CC_NAME CP_DISP_RUN_STATE
+ (( i=i+1 ))
+ [ 2 -eq 2 ]

Can you help me with this..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Comparing strings

I have two strings a=Mar22 b=may21 how can I compare them Is this fine if then; . ... else .... fi or if then (2 Replies)
Discussion started by: yakyaj
2 Replies

2. Shell Programming and Scripting

Comparing Two Strings

Hi All, While I am trying to run below code I Am getting the exception like ./abs.sh: line 102: syntax error near unexpected token `then' ./abs.sh: line 102: ` then' The Code Snippet is: if then cat $file1 | sed -e... (8 Replies)
Discussion started by: Anji
8 Replies

3. Shell Programming and Scripting

comparing strings

i have a string in a file which gets repeated number of times like below: rpttxt("abc") . . rpttxt("REP_TITLE") rpttxt("BOS_TITLE") . . . . and so on using awk or grep how can i comapre the string( as the second half keeps varying) and store it in a temporary variable? I am using the... (3 Replies)
Discussion started by: agarwal
3 Replies

4. Shell Programming and Scripting

comparing 2 strings

hi i have 2 strings. i want to compare the strings. please help (2 Replies)
Discussion started by: satish@123
2 Replies

5. Shell Programming and Scripting

comparing two strings

hi All i am facing prob in comparing two strings that have two word. below is the code snippet. checkValidates="file validates" file3_name="file" if then echo "file" $file3_name "is validated successfully" fi when i run this i get the error as -bash: [: too many arguments ... (1 Reply)
Discussion started by: infyanurag
1 Replies

6. Shell Programming and Scripting

Comparing strings using nawk

Hello All Please I have got a file called DATE.tex which consist of 01-04-2008_12:00:00 01-04-2005_12:00:00 01-04-2003_12:00:00 01-04-2007_12:00:00 01-04-2002_12:00:00 01-04-2009_12:00:00 I want to use nawk to print out the dates >=01-04-2009_12:00:00 I tried this cat plnt.new |... (6 Replies)
Discussion started by: ganiel24
6 Replies

7. Shell Programming and Scripting

Comparing strings with sed

Input: The the the the Output: not-same same What would be the sed command to do this? (7 Replies)
Discussion started by: cola
7 Replies

8. UNIX for Dummies Questions & Answers

Strings comparing incorrectly

Hello I'm very new to Linux and shell scripting so I only know basic stuff. I'm making a script with the purpose of finding the longest string or word in a file. Here's what I got so far: #!/bin/bash longest="" for i in $(strings -n $1); do if ] then longest=$i fi done echo $longest... (4 Replies)
Discussion started by: SCB
4 Replies

9. Shell Programming and Scripting

comparing strings as ints

Hi, So I got his code below. $year is a string of 2010,2011 etc. I guess I want to convert $year to an integer so I can do my if statement to see if the year string is greater than 2010? Or how could I do this? Right now I get a syntax error doing this. if; then do stuff fi (2 Replies)
Discussion started by: vsekvsek
2 Replies

10. Shell Programming and Scripting

Comparing Strings in ksh88

Hi I tried the following string comparison script in Ksh88 #!/bin/ksh str1='aC' str2='ABC' if then echo "Equal" else echo "Not Equal" fi Though str1 and str2 are not equal the script output says Equal . Please correct me Thanks (2 Replies)
Discussion started by: smile689
2 Replies
bup-margin(1)						      General Commands Manual						     bup-margin(1)

NAME
bup-margin - figure out your deduplication safety margin SYNOPSIS
bup margin [options...] DESCRIPTION
bup margin iterates through all objects in your bup repository, calculating the largest number of prefix bits shared between any two entries. This number, n, identifies the longest subset of SHA-1 you could use and still encounter a collision between your object ids. For example, one system that was tested had a collection of 11 million objects (70 GB), and bup margin returned 45. That means a 46-bit hash would be sufficient to avoid all collisions among that set of objects; each object in that repository could be uniquely identified by its first 46 bits. The number of bits needed seems to increase by about 1 or 2 for every doubling of the number of objects. Since SHA-1 hashes have 160 bits, that leaves 115 bits of margin. Of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. If you're paranoid about the possibility of SHA-1 collisions, you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. OPTIONS
--predict Guess the offset into each index file where a particular object will appear, and report the maximum deviation of the correct answer from the guess. This is potentially useful for tuning an interpolation search algorithm. --ignore-midx don't use .midx files, use only .idx files. This is only really useful when used with --predict. EXAMPLE
$ bup margin Reading indexes: 100.00% (1612581/1612581), done. 40 40 matching prefix bits 1.94 bits per doubling 120 bits (61.86 doublings) remaining 4.19338e+18 times larger is possible Everyone on earth could have 625878182 data sets like yours, all in one repository, and we would expect 1 object collision. $ bup margin --predict PackIdxList: using 1 index. Reading indexes: 100.00% (1612581/1612581), done. 915 of 1612581 (0.057%) SEE ALSO
bup-midx(1), bup-save(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-margin(1)
All times are GMT -4. The time now is 09:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy