Search Results

Search: Posts Made By: palanisvr
5,822
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,149
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,215
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...
10,565
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
2,370
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,630
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,034
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
25,962
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...
6,805
Posted By palanisvr
Try this one...
$echo Sample_ab_a.txt | sed s/.*_// | sed s/\.txt//
a
2,641
Posted By palanisvr
Try this
cat file.txt |tr ',' '\n' | tr -d ' '
21,657
Posted By palanisvr
Try this one.
$ echo "NZ-deploy-mode-1.15-Linux.x86_64.rpm" | sed 's/-1.*//'
NZ-deploy-mode
3,847
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,556
Posted By palanisvr
Try this.. ls -lrt Abc_Def* | sort -n
Try this..

ls -lrt Abc_Def* | sort -n
17,444
Posted By palanisvr
SQL loader is efficient one to load data from...
SQL loader is efficient one to load data from file.
2,748
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,499
Posted By palanisvr
Try this
sed s/' '//g temp.txt
1,749
Posted By palanisvr
Try this..
head -2 infile.txt |awk -F "=" '{print $2}' | tr -d \" | tr '\n' '/'
2,046
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,181
Posted By palanisvr
Please provide Inputs and output expected.
Please provide Inputs and output expected.
1,633
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...
5,715
Posted By palanisvr
cat temp.txt | sed /'^$'/d cat temp.txt |...
cat temp.txt | sed /'^$'/d

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

This should also work :

cat temp.txt | grep -v '^$'
2,518
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" >...
4,736
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,602
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:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy