variable1=`cat file2`
variable2=`cat file3`
if [ "$variable1" = "$variable2" ] # looking for content match of strings
then
echo "variable1"
else
echo " no match found"
fi
I need to write a script to find out if there are any .c files created/removed from the last time i monitored the files available. i first created a file to contain all the .c files available on the system. (ls *.c > file1)
I created another file using the same command.
I used the comm file1... (4 Replies)
I have searched and found a few threads that have dealt with this, but the examples I've tried haven't seemed to help.
I am monitoring our database log for high checkpoints.
I can parse out the checkpoint value which can be anywhere from zero into a 3 digit number.
I set a variable to be the... (3 Replies)
Script
#!/bin/sh
hardware=PC
os=WindowsNET
for i in `cat newservers`
do
x=`sudo /opt/openv/netbackup/bin/admincmd/bpplclients |grep $i |head -40 |grep $i|awk '{print $3;exit}'`
if
then
echo "$i is already added"
else
echo "Need to add"
fi
done
O/p in debug mode
bash-2.05$... (3 Replies)
hi
i have a set of files , i need to compare one file content with other file content,
i am using cmp -s abc.1 def.2 , but it is not giving theproper o/p even if the content is different.Please help
thanks
Satya (1 Reply)
im trying to compare ipaddresses. i loop through an array to see if the ip is already is in the array and if it is it should set a flag and then i wont add it to the array. but its just adding all the ipaddresses to the array
if ]
then
... (3 Replies)
Can someone please help me out here?
I have strings similar to aafafaff45,29.34.942.45,edfdfafa that i want to compare to another similar string to check if they are the same. my script isn't working.
ONE="aafafaff45,29.34.942.45,edfdfafa"
TWO="ddfafagfa,87.57.942.45,afafafff"
if ONE is... (5 Replies)
I have very abstract need of "comparing two variables" and take subsequent actions.
please refer to image below
https://lh3.googleusercontent.com/-frNk5iA3q1c/TjI3lE0sWOI/AAAAAAAAAIE/fxzB1w07gas/script_block.JPG
I have a part of script which reads a file and generates variables based on... (4 Replies)
I have a script like this. Just couldn't get the comparison part work. Any thought? thanks,
#!/usr/bin/ksh -x
STEP=`echo $(basename $0 .ksh) | tr "" ""`
log=/skip.log
while read LINE
do
if
then
echo `date`: STEP $STEP skipped by user >> $log
exit 0
fi
done < $1
echo... (0 Replies)
Discussion started by: ghostmic
0 Replies
LEARN ABOUT DEBIAN
spoon::base
Spoon::Base(3pm) User Contributed Perl Documentation Spoon::Base(3pm)NAME
Spoon::Base - Generic Spoon Base Class
SYNOPSIS
use Spoon::Base '-Base';
DESCRIPTION
Base class for application plugins. Provides basic functionality to all modules inheriting from this class.
SUBROUTINES
These subroutines are meant to be called bare, not as an object-method call.
trace
See Spoon::Trace::trace().
conf(name, default)
Returns the configuration value for "name", if it can be found in the config ($self->hub->config). Returns $default, otherwise.
METHODS
hub
Return the application's hub object. See Spoon::Hub.
init
Inherited by all subclasses. Put your class initialization stuff here.
assert(boolean)
Die if the supplied argument is false.
t([label])
Calls Spoon::Trace::mark(). See Spoon::Trace.
clone
Copies a class instance. The copy is only a shallow one.
is_in_cgi
Returns a boolean, indicating whether we were called from a CGI interface.
is_in_test
Returns a boolean, indicating whether we were called from a test suite.
have_plugin(class_id)
Tries to load a plugin. See Spoon::Hub::load_class().
plugin_directory
Returns your plugin's directory. You can use this directory to store state.
env_check(variable_name)
Sanity check: ensure the specified variable exists in %ENV. If the variable is not found, dies with a useful error message.
dumper_to_file(filepath, variable1 [, variable2...])
Uses Data::Dumper to save a dump of one or more variables to the specified file.
has_utf8
Returns a boolean, indicating whether utf8 is available on this platform and version of perl.
utf8_encode(string)
Encodes the string in utf8, if utf8 is available. Otherwise, returns $string unmodified. See Encode::encode().
utf8_decode(string)
Decodes the string from utf8, if utf8 is available. Otherwise, returns $string unmodified. See Encode::decode().
uri_escape(string)
Escapes all invalid URI characters. See CGI::Util::escape().
uri_unescape(string)
Unescapes all invalid URI characters. See CGI::Util::unescape().
html_escape(string)
Escapes all reserved characters. The result is suitable for including verbatim in an HTML document. See CGI::escapeHTML().
html_unescape(string)
Escapes all reserved characters. The result is suitable for including verbatim in an HTML document. See CGI::unescapeHTML().
base64_encode(string)
Encodes the specified string into Base64. See MIME::Base64::encode_base64().
base64_encode(base64_data)
Decodes the specified data from Base64. See MIME::Base64::decode_base64().
TODO
* Document what Spoon::Base->debug() does.
AUTHOR
Brian Ingerson <INGY@cpan.org>
COPYRIGHT
Copyright (c) 2004. Brian Ingerson. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
perl v5.12.4 2006-11-09 Spoon::Base(3pm)