I am writing a ksh to check for duplicate records in two different set of tables on oracle database, to get this i am running two plsql qurries at a time through the ksh, so the output of the qurries will be stored in variable say "SQL_STRING". So now to say if duplicate records exists in table or not i have to write a script which checks the count of the word "no rows selected" in the SQL_STRING variable.
One of our friend on UNIX.COM helped me with the code below which counts from a file instead of from a variable
Code:
#!/bin/ksh
str='no rows selected'
num=$(awk '{n+=gsub(str,"")}END{print n}' str="${str}" mySampleFile.txt)
echo "Total number of [${str}] = ${num}"
For example the variable SQL_STRING has data as below:
no rows selected no rows selected
ora-1234 sql querry failed
no rows selected
Now we should look for the string "no rows selected" (note: it has spaces between) in the variable SQL_STRING and then store the count of the string in a variable.
for the above data the output should be 3 since the string "no rows selected" occurred three times.
Any help is appreciated.
Hi,
i call my shell like:
my_shell "my project name"
my script:
#!/bin/bash -vx
projectname=$1
sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp
cp temp test_config_doxy
the following error occurres:
sed s/'PROJECT_NAME ... (2 Replies)
Hi ,
I have below file with 13 columns. I need 2-13 columns seperated by comma and I want to append each row with a string "INSERT INTO xxx" in the begining as 1st column and then a variable "$node" and then $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13 and at the end another string " ; COMMIT;"
... (4 Replies)
I am writing ksh to check for duplicate records in two different set of tables on oracle database, to get this i am running two plsql qurries at a time through the ksh, so the output of the qurries will be stored in variable say "SQL_STRING". So now to say if duplicate records exists in table or... (3 Replies)
Hi All
I've very nearly finished this script I'm working on but have hit another idiots problem, after googling I can't see a solution for this one.
I have a while count loop that checks checks two consecutive values then increments the count by two.
What the script has to do is then check... (5 Replies)
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
Hi All,
I am trying to to compare a string variable with a string literal inside a loop but keep getting the
./testifstructure.sh: line 6:
#!/bin/sh
BOOK_LIST="BOOK1 BOOK2"
for BOOK in ${BOOK_LIST}
do
if
then echo '1'
else
echo '2'
fi
done
Please use next... (1 Reply)
I have a large dataset with following structure;
C 0001 Carbon
D SAR001 methane
D SAR002 ethane
D SAR003 propane
D SAR004 butane
D SAR005 pentane
C 0002 Hydrogen
C 0003 Nitrogen
C 0004 Oxygen
D SAR011 ozone
D SAR012 super oxide
C 0005 Sulphur
D SAR013... (3 Replies)
Input:
|Running the Rsync|Sun Oct 16 22:48:01 BST 2016
|End of the Rsync|Sun Oct 16 22:49:54 BST 2016
|Running the Rsync|Sun Oct 16 22:54:01 BST 2016
|End of the Rsync|Sun Oct 16 22:55:45 BST 2016
|Running the Rsync|Sun Oct 16 23:00:02 BST 2016
|End of the Rsync|Sun Oct 16 23:01:44 BST 2016... (4 Replies)
Below is my ksh shell script where I need to check if variable fileprops is a subset of $1 argument.
echo "FILE PROPERTY: $fileprops"
echo "PARAMETER3: $1"
if ; then
echo "We are Good. $line FILE is found to be INTACT !! "
else
echo... (2 Replies)
Discussion started by: mohtashims
2 Replies
LEARN ABOUT CENTOS
rgb2ycbcr
RGB2YCBCR(1) General Commands Manual RGB2YCBCR(1)NAME
rgb2ycbcr - convert non-YCbCr TIFF images to a YCbCr TIFF image
SYNOPSIS
rgb2ycbcr [ options ] src1.tif src2.tif ... dst.tif
DESCRIPTION
rgb2ycbcr converts RGB color, greyscale, or bi-level TIFF images to YCbCr images by transforming and sampling pixel data. If multiple files
are specified on the command line each source file is converted to a separate directory in the destination file.
By default, chrominance samples are created by sampling 2 by 2 blocks of luminance values; this can be changed with the -h and -v options.
Output data are compressed with the PackBits compression scheme, by default; an alternate scheme can be selected with the -c option. By
default, output data are compressed in strips with the number of rows in each strip selected so that the size of a strip is never more than
8 kilobytes; the -r option can be used to explicitly set the number of rows per strip.
OPTIONS -c Specify a compression scheme to use when writing image data: -c none for no compression, -c packbits for the PackBits compression
algorithm (the default), -c jpeg for the JPEG compression algorithm, -c zip for the deflate compression algorithm, and -c lzw for
Lempel-Ziv & Welch.
-h Set the horizontal sampling dimension to one of: 1, 2 (default), or 4.
-r Write data with a specified number of rows per strip; by default the number of rows/strip is selected so that each strip is approxi-
mately 8 kilobytes.
-v Set the vertical sampling dimension to one of: 1, 2 (default), or 4.
SEE ALSO tiffinfo(1), tiffcp(1), libtiff(3)
Libtiff library home page: http://www.remotesensing.org/libtiff
libtiff November 2, 2005 RGB2YCBCR(1)