01-15-2008
String comparision in shell scripting
Hi Guys,
I am new to scripting
I have written a code to compare strings,but I am getting some Exception
Code snippet:
MODE="D"
if [[ $MODE = "D" ]]; then
. $file1
fi
Error:
./BatchJobs.sh: [[: execute permission denied
I have given all Execute permissions to the script(chmod 755 BatchJobs.sh)
Can anybody help me in this
Thanks in advance
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All,
I've to compare the number of records present in a file against its trailer count.
for ex:
rec_cnt=$(awk 'END{print NR}' file.txt)
trl_cnt=$(tail -1 file.txt| cut -c1-6)
problem is trailer is appended with zero's and while comparing it is giving problem.
i.e, rec_cnt=9 and... (1 Reply)
Discussion started by: ganapati
1 Replies
2. Shell Programming and Scripting
Hi, I would like to compare the 25th position of the file with the character '(' and if it is not equal then it would generate a mail. I have used the below if condition, however it is always executing the code within if, even the comparison is expected to return false.
if
Please help me... (1 Reply)
Discussion started by: kdheepan
1 Replies
3. Shell Programming and Scripting
Hi,
if I have a string delimited by commas how can I put each character on a new line followed by a carriage return, and output this to a filee.g
from:
s,t,r,i,n,g
to
s
t
r
i
n
g
thanks you (3 Replies)
Discussion started by: Wahmed9
3 Replies
4. Shell Programming and Scripting
Hi,
I am having difficulty to compare a string in a file against a date from a a table and print the latest date. Below are the values.
String in File : 2009-12-02 00:37:51
Value Table : 2010-01-10-02.00.49.294758
I have to compare both the values ( Ignore the Microsecond in the table... (5 Replies)
Discussion started by: sam_78_nyc
5 Replies
5. Shell Programming and Scripting
hi all ,
i am looking for a shell script which looks into a directory of text files and searches for a string(abc123) in all the text files and if that exists add a new line(abc124) in all the *.txt files automatically, or if (abc124) exists add (abc123) can you all please help me. (6 Replies)
Discussion started by: joseph.dmello
6 Replies
6. Shell Programming and Scripting
have written a simple shell script to do some automation work. Basically the script searches for all the files in the current path and if the file is a specified one, it does some action. Below are the relevant lines ---
#!/bin/bash
1.for i in ls *
2.do
3.if
4.then .... //do something... (3 Replies)
Discussion started by: Dev_Sharma987
3 Replies
7. Shell Programming and Scripting
I have a string like ab or abc of whatever length. But i want to know whether another string ( for example, abcfghijkl, OR a<space> bcfghijkl ab<space> cfghijkl OR a<space>bcfghijkl OR ab<space> c<space> fghijkl ) starts with ab or abc... space might existing on the longer string... If so, i... (1 Reply)
Discussion started by: nram_krishna@ya
1 Replies
8. Shell Programming and Scripting
I want to compare two strings using awk dynamically without trimming the spaces and want to find the count of matching string.
Input Strings file:
File1 content (file1):
" a "
" a2 "
File2 content (file2):
" a "
" a "
" a2 "
" b2 "
" c2 "... (3 Replies)
Discussion started by: AhmedLakadkutta
3 Replies
9. UNIX and Linux Applications
Hi,
We need to compare a text file File1.txt and config file File2.txt in a way that it checks if the content of File1.txt exists between the range mentioned in File2.cfg.
The range here is the range between col1 and col2 of File2.cfg
If the content of File1.txt lies between the range of... (12 Replies)
Discussion started by: CFA
12 Replies
10. Shell Programming and Scripting
Hi All,
sessionid_remote=$(echo "select odb_sessionid from sysopendb where odb_dbname='syscdr';" | sudo -u cucluster ssh ucbu-aricent-vm93 "source /opt/cisco/connection/lib/connection.profile; $INFORMIXDIR/bin/dbaccess sysmaster@ciscounity")
for sid in $sessionid_remote;do
if * ]];... (2 Replies)
Discussion started by: deeptis
2 Replies
LEARN ABOUT DEBIAN
jifty::handle
Jifty::Handle(3pm) User Contributed Perl Documentation Jifty::Handle(3pm)
NAME
Jifty::Handle -- A database handle class for Jifty
DESCRIPTION
A wrapper around Jifty::DBI::Handle which is aware of versions in the database
METHODS
new PARAMHASH
This class method instantiates a new Jifty::Handle object. This object deals with database handles for the system. After it is created, it
will be a subclass of Jifty::DBI::Handle.
canonical_database_name
Returns the canonical name of the application's database (the actual name that will be given to the database driver). This name is a
lower-case version of the "Database" argument in the "Database" section of the framework config.
For SQLite databases (where the database name is actually a filename), this also converts a relative path into an absolute path based at
the application root.
connect ARGS
Like Jifty::DBI's connect method but pulls the name of the database from the current Jifty::Config.
check_schema_version [pretend => 0|1]
Make sure that we have a recent enough database schema. If we don't, then error out.
If "pretend =" 1> is passed, then any auto-upgrade action this might take is dry-run only.
create_database MODE
"MODE" is either "print" or "execute".
This method either prints the commands necessary to create the database or actually creates it, depending on the value of MODE. Returns
undef on failure.
drop_database MODE
"MODE" is either "print" or "execute".
This method either prints the commands necessary to drop the database or actually drops it, depending on the value of MODE. Returns undef
on failure.
AUTHOR
Various folks at BestPractical Solutions, LLC.
perl v5.14.2 2011-01-24 Jifty::Handle(3pm)