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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT DEBIAN
ipsec_version_string
IPSEC_IPSEC_VERSION_CODE(3) Library Functions Manual IPSEC_IPSEC_VERSION_CODE(3)NAME
ipsec_ipsec_version_code, ipsec_ipsec_version_string, ipsec_ipsec_copyright_notice - get IPsec version code, full version string, copyright
notice
SYNOPSIS
#include <freeswan.h>
const char *ipsec_version_code(void);
const char *ipsec_version_string(void);
const char **ipsec_copyright_notice(void);
DESCRIPTION
These functions provide information on version numbering and copyright of the Linux FreeS/WAN IPsec implementation.
Ipsec_version_code returns a pointer to a string constant containing the current IPsec version code, such as ``1.92'' or
``snap2001Nov19b''.
Ipsec_version_string returns a pointer to a string constant giving a full version identification, consisting of the version code preceded
by a prefix identifying the software, e.g. ``Linux FreeS/WAN 1.92''.
Ipsec_copyright_notice returns a pointer to a vector of pointers, terminated by a NULL, which is the text of a suitable copyright notice.
Each pointer points to a string constant (possibly empty) which is one line of the somewhat-verbose copyright notice. The strings are NUL-
terminated and do not contain a newline; supplying suitable line termination for the output device is the caller's responsibility.
SEE ALSO ipsec(8)HISTORY
Written for the FreeS/WAN project by Henry Spencer.
21 Nov 2001 IPSEC_IPSEC_VERSION_CODE(3)