Sponsored Content
Top Forums Shell Programming and Scripting how to avoid 'unexpected operator' error when comparing 2 strings Post 302443243 by Corona688 on Saturday 7th of August 2010 06:59:41 PM
Old 08-07-2010
If the program returns success, it prints match. If it returns error, it prints mismatch. The rest is redirection to shunt all the unneeded output into /dev/null where it will go away and never be heard from again.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comparing two strings

Hi How do i compare two strings in shell script. Below is an example but I am not getting the desired output, plz help if then echo success fi I am not getting the desired output if I do this. plz help (24 Replies)
Discussion started by: ragha81
24 Replies

2. 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

3. 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

4. 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

5. 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

6. 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

7. Shell Programming and Scripting

syntax error: `-a' unexpected operator/operand in IF

When i tyr this, it gives me a syntax error...i tried removing quotes,removing spaces,replacing -eq with '='.. Can somebody suggest that is the problem? if ]; then (4 Replies)
Discussion started by: dba.admin2008
4 Replies

8. UNIX for Dummies Questions & Answers

How do I search for 2 strings (AND operator) ?

I have a need to search for files containing 2 strings as in (AND operator). No one at my site seems to know if it is possible. There is only documentation for the "or' operator. I know I can do a search, copy all the matched files into a temp directory & do the second search in the temp... (14 Replies)
Discussion started by: Kartheg
14 Replies

9. Shell Programming and Scripting

ksh-script "arithmetic syntax error" comparing strings

Hi all, Iīve already searched the forum but canīt find what i am doing wrong. I am trying to compare two variables using ksh under red hat. The error I get is: -ksh: .: MDA=`md5sum /tmp/ftp_dir_after_transfer | cut -d' ' -f1 ` MDB=`md5sum /tmp/ftp_dir_before_transfer | cut -d' ' -f1 `... (3 Replies)
Discussion started by: old_mike
3 Replies

10. 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
DEBUGREISERFS(8)					      System Manager's Manual						  DEBUGREISERFS(8)

NAME
debugreiserfs - The debugging tool for the ReiserFS filesystem. SYNOPSIS
debugreiserfs [ -dDJmoqpuSV ] [ -j device ] [ -B file ] [ -1 N ] device DESCRIPTION
debugreiserfs sometimes helps to solve problems with reiserfs filesystems. When run without options it prints the super block of the Reis- erFS filesystem found on the device. device is the special file corresponding to the device (e.g /dev/hdXX for an IDE disk partition or /dev/sdXX for a SCSI disk partition). OPTIONS
-j device prints the contents of the journal. The option -p allows it to pack the journal with other metadata into the archive. -J prints the journal header. -d prints the formatted nodes of the internal tree of the filesystem. -D prints the formatted nodes of all used blocks of the filesystem. -m prints the contents of the bitmap (slightly useful). -o prints the objectid map (slightly useful). -B file takes the list of bad blocks stored in the internal ReiserFS tree and translates it into an ascii list written to the specified file. -1 blocknumber prints the specified block of the filesystem. -p extracts the filesystem's metadata with debugreiserfs -p /dev/xxx | gzip -c > xxx.gz. None of your data are packed unless a filesys- tem corruption presents when the whole block having this corruption is packed. You send us the output, and we use it to create a filesystem with the same strucure as yours using debugreiserfs -u. When the data file is not too large, this usually allows us to quickly reproduce and debug the problem. -u builds the ReiserFS filesystem image with gunzip -c xxx.gz | debugreiserfs -u /dev/image of the previously packed metadata with debugreiserfs -p. The result image is not the same as the original filesystem, because mostly only metadata were packed with debu- greiserfs -p, but the filesystem structure is completely recreated. -S When -S is not specified -p deals with blocks marked used in the filesystem bitmap only. With this option set debugreiserfs will work with the entire device. -q When -p is in use, suppress showing the speed of progress. AUTHOR
This version of debugreiserfs has been written by Vitaly Fertman <vitaly@namesys.com>. BUGS
Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing as much information as possible--your hardware, kernel, patches, settings, all printed messages; check the syslog file for any related information. SEE ALSO
reiserfsck(8), mkreiserfs(8) Reiserfsprogs 3.6.21 January 2009 DEBUGREISERFS(8)
All times are GMT -4. The time now is 11:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy