Search Results

Search: Posts Made By: Rami Reddy
2,569
Posted By Yoda
You could use a grouping command...
You could use a grouping command (http://www.gnu.org/software/bash/manual/bashref.html#Command-Grouping) form:
for file in *.sql
do
{
echo "create or replace"
...
2,569
Posted By Just Ice
make sure you support your local charities ... ...
make sure you support your local charities ...
echo "create or replace" > /tmp/sqlfile
cat yourfile.sql >> /tmp/sqlfile
echo "/" >> /tmp/sqlfile
mv /tmp/sqlfile yourfile.sql
2,569
Posted By vidyadhar85
Try below. for file in *.sql ; do awk...
Try below.


for file in *.sql ; do
awk 'BEGIN{printf "create or replace "}{print $0}END{print "/"}' $file > temp
mv temp $file
done
2,569
Posted By rajamadhavan
Do you need it on all the lines of the *.sql or...
Do you need it on all the lines of the *.sql or only at the start and end of the file ?
For all the lines, here is the solution

sed -e 's/^/create /g' -e 's/$/ \//g' file > new-file
3,460
Posted By vidyadhar85
try below if if [ `egrep -c "$names"...
try below if


if [ `egrep -c "$names" ${FILENAME}` -eq 0 ]; then
echo "file not present"
else
echo "file present"
fi
3,460
Posted By vidyadhar85
To start with you are storing the sqlplus result...
To start with you are storing the sqlplus result under names variable but using $name in egrep
4,911
Posted By franzpizzo
Hi, I add a clarification: if you apply this...
Hi, I add a clarification: if you apply this solution to the error output of a script may be necessary to redirect execute a redirect

./script.sh 2>&1 | awk -F' |:' '{print $4}'
4,911
Posted By Jotne
awk -F' |:' '{print $4}' file
awk -F' |:' '{print $4}' file
4,911
Posted By PikK45
grep -o [0-9]* file
grep -o [0-9]* file
4,911
Posted By anbu23
awk -F'[ :]' { print $(NF-1) } ' file
awk -F'[ :]' { print $(NF-1) } ' file
4,911
Posted By panyam
use "cut" command
use "cut" command
1,833
Posted By DGPickett
Which database? I see sqlplus. Oracle has a...
Which database? I see sqlplus. Oracle has a facility to map files as tables, but very much for the DBA to set up and control. There is bcp and similar tools for SQL Server and Sybase, DB2 has a...
1,454
Posted By bakunin
Your sample script is wrong on so many points i...
Your sample script is wrong on so many points i don't even know where to start:

#!/bin/bash
#SCRIPT: method2.sh
#PURPOSE: Process a file line by line with redirected while-read loop.
...
1,454
Posted By panyam
still not sure what exactly you need.!!! ...
still not sure what exactly you need.!!!

where does $Line in your script comes from?

Assuming that the file content is a file name, something like this should be enough. I assume that...
278,921
Posted By Neo
Simple rules of the UNIX.COM forums:
RULES OF THE UNIX AND LINUX FORUMS

For the latest version of the community rules (the official community rules page), please visit here. (https://www.unix.com/misc.php?do=cfrules)


No flames,...
Showing results 1 to 15 of 15

 
All times are GMT -4. The time now is 10:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy