Search Results

Search: Posts Made By: palanisvr
7,597
Posted By palanisvr
Hope this will help. #!/bin/sh ...
Hope this will help.

#!/bin/sh
no_of_rows="1"
file_nm=new_file

if [ -f temp.dat ]
then
rm -f temp.dat
fi

#Writes the data to a file (temp.dat)
sqlplus scott/tiger@database<<EOF
set...
3,820
Posted By palanisvr
fetch the text_file name in a dynamic way instead...
fetch the text_file name in a dynamic way instead of hardcoding , this will solve your problem

sqlplus -s user/pwd@dbname @$text_file
3,704
Posted By palanisvr
for i in `cat file` do fld1=`echo $i | tr -d...
for i in `cat file`
do
fld1=`echo $i | tr -d '[0-9]'`
fld2=`echo $i | tr -d '[a-z]' |tr -d '[A-Z]'`
echo $fld1 " " $fld2 >> tmp.txt
sort -n -k2 tmp.txt |awk -F ' ' '{print $1$2}'
rm -f tmp.txt...
11,165
Posted By palanisvr
Try this ...
suppose that file content lies in a.txt

fld1=`awk -F'=' '{print $1}' a.txt|tr '\n' ','|sed s/".$"//`
fld2=`awk -F'=' '{print $2}' a.txt|tr '\n' ','|sed s/".$"//`
echo $fld1
echo $fld2
3,184
Posted By palanisvr
Try this ...
for i in `cat a.txt`
do
num=`echo "$i" |awk -F',' '{print $1 "," $2}'`
for j in `echo "$i"|tr ',' '\n'|sed -n '3,$p'`
do
echo $num","$j
done
done
2,985
Posted By palanisvr
can you provide a sample input file and desired...
can you provide a sample input file and desired output file for the same.
1,081
Posted By palanisvr
for i in `cat num.txt` do search=`grep "$i"...
for i in `cat num.txt`
do
search=`grep "$i" data.txt`
ret_cd=$?
if [ "$ret_cd" -gt 0 ]
then
echo "Match not found ,run a command"
fi
done
28,987
Posted By palanisvr
Try this ..
I don't have expertise in Sybase , I am giving sample programme in Oracle to capture the error using the shell script hope this will help you.

Sample procedure : You have to make sure the created...
7,222
Posted By palanisvr
Try this one...
$echo Sample_ab_a.txt | sed s/.*_// | sed s/\.txt//
a
3,101
Posted By palanisvr
Try this
cat file.txt |tr ',' '\n' | tr -d ' '
22,300
Posted By palanisvr
Try this one.
$ echo "NZ-deploy-mode-1.15-Linux.x86_64.rpm" | sed 's/-1.*//'
NZ-deploy-mode
5,368
Posted By palanisvr
Try this ...
#capture the script request in a unix host variable from database
v_script_request==`sqlplus -s user/password@dbname <<!
set feedback off heading off pagesize 0
select REQUEST_ACTION from...
2,769
Posted By palanisvr
Try this.. ls -lrt Abc_Def* | sort -n
Try this..

ls -lrt Abc_Def* | sort -n
18,617
Posted By palanisvr
SQL loader is efficient one to load data from...
SQL loader is efficient one to load data from file.
3,366
Posted By palanisvr
Can you come with a example of exactly what you...
Can you come with a example of exactly what you need.
3,854
Posted By palanisvr
Try this
sed s/' '//g temp.txt
2,014
Posted By palanisvr
Try this..
head -2 infile.txt |awk -F "=" '{print $2}' | tr -d \" | tr '\n' '/'
2,406
Posted By palanisvr
This is how it works out. you have to open sql...
This is how it works out.
you have to open sql session by issuing proper credentials to the login db and simply execute any command , procedure vice versa.


sqlplus -s...
4,649
Posted By palanisvr
Please provide Inputs and output expected.
Please provide Inputs and output expected.
2,044
Posted By palanisvr
Try with this..
Code :

$cat test.fnc
v1=$1
function findRecord() {
output=`grep $v1 recordDatabase`
echo $output
}
#call function
findRecord

execute the function

$sh...
6,396
Posted By palanisvr
cat temp.txt | sed /'^$'/d cat temp.txt |...
cat temp.txt | sed /'^$'/d

cat temp.txt | grep -v '^$'
1,963
Posted By palanisvr
cat temp.txt | sed /'^$'/d This should...
cat temp.txt | sed /'^$'/d

This should also work :

cat temp.txt | grep -v '^$'
3,239
Posted By palanisvr
Try this one
#!/bin/sh
file_name="tempfile.txt"
previous_day=`TZ=GMT+24 date +%b" "%d`

file_cnt=`ls -lrt $file_name| grep "$previous_day" | wc -l`

if [ "$file_cnt" -gt 0 ]
then
echo "00000000" >...
5,502
Posted By palanisvr
Execute a shell script from Oracle procedure
Hi Gurus,

Want to execute a shell script from a oracle procedure and get the status of the same, any assistance in this regard will be appreciated.

proc_data.sh is script name which I want to...
1,717
Posted By palanisvr
Thanks a lot for your prompt and useful reply on...
Thanks a lot for your prompt and useful reply on this, will try to use these options.
Showing results 1 to 25 of 103

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