Search Results

Search: Posts Made By: palanisvr
7,574
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,805
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,691
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,149
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,175
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,981
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,080
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,931
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,221
Posted By palanisvr
Try this one...
$echo Sample_ab_a.txt | sed s/.*_// | sed s/\.txt//
a
3,092
Posted By palanisvr
Try this
cat file.txt |tr ',' '\n' | tr -d ' '
22,273
Posted By palanisvr
Try this one.
$ echo "NZ-deploy-mode-1.15-Linux.x86_64.rpm" | sed 's/-1.*//'
NZ-deploy-mode
5,353
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,767
Posted By palanisvr
Try this.. ls -lrt Abc_Def* | sort -n
Try this..

ls -lrt Abc_Def* | sort -n
18,581
Posted By palanisvr
SQL loader is efficient one to load data from...
SQL loader is efficient one to load data from file.
3,356
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,849
Posted By palanisvr
Try this
sed s/' '//g temp.txt
2,006
Posted By palanisvr
Try this..
head -2 infile.txt |awk -F "=" '{print $2}' | tr -d \" | tr '\n' '/'
2,401
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,643
Posted By palanisvr
Please provide Inputs and output expected.
Please provide Inputs and output expected.
2,034
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,388
Posted By palanisvr
cat temp.txt | sed /'^$'/d cat temp.txt |...
cat temp.txt | sed /'^$'/d

cat temp.txt | grep -v '^$'
1,962
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,235
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,496
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,715
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 08:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy