You can combine search and replacement in sed. Syntax:
sed -n -- only print lines when asked to do so
'/pattern/ -- search for pattern
s/foo/bar/ -- if found replace only on this line foo by bar
p -- print lines only if substitution took place.
Dear All,
This may sound a simple query but a non technical person like me is not able to do it, So please help me out.
I m using Unix... isql
I jst wanted to do something like following
select * from xyz
where ID= xxxxxxxx (8 digit ID)
Here if i put single 8 digit ID then the... (5 Replies)
Guys,
I guess, I posted something in the wrong forum. Here it is -
https://www.unix.com/shell-programming-scripting/67395-perl-postgrepsql-question.html
Can you please help me with this?
Regards,
garric (0 Replies)
Hi,
I wanted to o/p the number of rows in a table to a variable in linux. How can i achieve this.
I wrote the query and its settings like feedback, pagesize line size in a file and using this file as a parameter to the sqlplus command. now can i redirect the o/p of that query to a variable.... (2 Replies)
Hi,
I need to get the value from the table using the sql command and store this value into the unix variable so that i can use this value for furthure use..
Please can any body help me in this regards
Thanks & Regards
Abdul Hafeez Shaik (17 Replies)
Can someone tell me why I'm getting error when I try to run this?
#!/bin/csh -f
source ~/.cshrc
#
set SQLPLUS = ${ORACLE_HOME}/bin/sqlplus
#
set count=`$SQLPLUS -s ${DB_LOGIN} << END
select count(1) from put_groups where group_name='PC' and description='EOD_EVENT' and serial_number=1;... (7 Replies)
How can I send the results of a query to a unix variable. I basically want to run a query then do some logic on the results. Trying to redirect the result into a variable I define in the script.
select count(*) as counter from table - nut to redirect the "count" returned from the query... (2 Replies)
I have been asked to create a shell script that accepts a number of SQL select queries as input, runs them in sequence, spools the output to an EXCEL workbook, where, each worksheet is an output of a Select statement run above.
The workbook should be in a .XLS format. If a particular select... (2 Replies)
hi..
i need to optimize my select query ..
my situation is like this ..
i have 15 lac recors in my table..
the following query takes nine seconds to give the required output..
SELECT max(ah.AUC_AMT),
SUBSTRING_INDEX(GROUP_CONCAT(SUBSTRING_INDEX(ah.AUC_CUS_NAME,'@',1) order by AUC_AMT... (0 Replies)
hi..
i need to optimize my select query ..
my situation is like this ..
i have 15 lac recors in my table..
the following query takes nine seconds to give the required output..
SELECT max(ah.AUC_AMT),
SUBSTRING_INDEX(GROUP_CONCAT(SUBSTRING_INDEX(ah.AUC_CUS_NAME,'@',1) order by AUC_AMT... (1 Reply)
echo "set echo off"; echo "set feedback off"; echo "set linesize 4000"; echo " set pagesize 0"; echo " set sqlprompt ''"; echo " set trimspool on";
Select statement is mentioned below
echo "select res.ti_book_no from disney_ticket_history res where res.ti_status =${STATUS} and... (7 Replies)
Discussion started by: aroragaurav.84
7 Replies
LEARN ABOUT DEBIAN
debconf-copydb
DEBCONF-COPYDB(1) Debconf DEBCONF-COPYDB(1)NAME
debconf-copydb - copy a debconf database
SYNOPSIS
debconf-copydb sourcedb destdb [--pattern=pattern] [--owner-pattern=pattern] [--config=Foo:bar]
DESCRIPTION
debconf-copydb copies items from an existing debconf database into another, possibly new database. The two databases may have different
formats; if so a conversion will automatically be done.
OPTIONS
sourcedb
The name of the source database. Typically it will be defined in your debconf.conf (or .debconfrc) file.
destdb
The name of the destination database. It may be defined in debconf.conf or .debconfrc, or you might define it on the command line (see
below).
-p pattern, --pattern pattern
If this is specified, only items in sourcedb whose names match the pattern will be copied.
--owner-pattern pattern
If this is specified, only items in sourcedb whose owners match the pattern will be copied.
-c foo:bar, --config Foo:bar
Set option Foo to bar. This is similar to writing:
Foo: bar
In debconf.conf, except you probably want to leave off the space on the command line (or quote it: "Foo: bar"). Generally must be used
multiple times, to build up a full configuration stanza. While blank lines are used to separate stanzas in debconf.conf, this program
will assume that "Name:dbname" denotes the beginning of a new stanza.
EXAMPLES
debconf-copydb configdb backup
Copy all of configdb to backup, assuming you already have the backup database defined in debconf.conf.
debconf-copydb configdb newdb --pattern='^slrn/'
--config=Name:newdb --config=Driver:File
--config=Filename:newdb.dat
Copy slrn's data out of configdb, and into newdb. newdb is not defined in the rc file, so the --config switches set up the database on the
fly.
debconf-copydb configdb stdout -c Name:stdout -c Driver:Pipe
-c InFd:none --pattern='^foo/'
Spit out all the items in the debconf database related to package foo.
debconf-copydb configdb pipe --config=Name:pipe
--config=Driver:Pipe --config=InFd:none |
ssh remotehost debconf-copydb pipe configdb
--config=Name:pipe --config=Driver:Pipe
This uses the special purpose pipe driver to copy a database to a remote system.
SEE ALSO debconf.conf(5)AUTHOR
Joey Hess <joeyh@debian.org>
2012-09-10 DEBCONF-COPYDB(1)