Search Results

Search: Posts Made By: sunpraveen
7,541
Posted By sunpraveen
Encrypt Password file and decrypt in a shell script
Hi All,
I have stored Oracle database passwords in a hidden file - .pass_file.
My shell script reads the hidden file, gets the password and then logs in to the Oracle database and runs some SQL...
1,433
Posted By sunpraveen
Thanks for the replies. My understanding is...
Thanks for the replies.

My understanding is that any variable that is instantiated inside a while loop can not be used outside the loop.

So, the workaround would be to redirect the variable...
1,433
Posted By sunpraveen
Remote nodes - login and find number of processes
Hello all,

This is my requirement:

1. I have 6 VMs running Apache (for Oracle EBS) as Linux user oracle.

2. From a central server (VM), I need to login to all the 6 VMs as oracle user (I...
23,084
Posted By sunpraveen
You can use while loop for this: :cool: ...
You can use while loop for this: :cool:

while read line
do
if [ "${line}" = "no rows selected" ]
then
echo "No session is blocked"
else
cat $OUTFILE | mailx -s...
2,091
Posted By sunpraveen
Use this. Let me know how it goes.:cool: ...
Use this. Let me know how it goes.:cool:

sed -e 's/<string>/ /g' < filename


HTH,

Regards,

Praveen
9,893
Posted By sunpraveen
script submitted using ssh does not return to command prompt
Gurus,

I have written a shell script to backup a database and applications. This is how the script works:

1. As applications user (say applmgr), the main backup script, say backup.sh, is...
16,144
Posted By sunpraveen
Alister and ygemici, Thanks a lot for your...
Alister and ygemici, Thanks a lot for your invaluable suggestions and tips.

My friend also suggested one solution.


Since the backup will take a minimum of 5-6 hours, instead of writing a...
16,144
Posted By sunpraveen
Monitor a long running process
Gurus,

I am writing a shell script that will be used to automate cold backup of an Oracle Database. The database size is around 300G and will take around 5-6 hours to copy.

I have finished...
3,287
Posted By sunpraveen
Can you be a little bit more specific? Your...
Can you be a little bit more specific? Your statements are quite confusing. :confused:


Regards,

Praveen
12,073
Posted By sunpraveen
The best way to ignore case is to convert the...
The best way to ignore case is to convert the user input to upper case (or lower case - your choice).

Try this:


$ choice="yes"

$ echo ${choice} | tr "[a-z]" "[A-Z]"
YES
$


HTH,...
5,491
Posted By sunpraveen
Try this: find /home/shantanu -name...
Try this:


find /home/shantanu -name 'my_stops*' | xargs ls -lt | tail +3 | awk '{print $9}' | xargs rm -f


Note: This is untested since it involves deletion. Please test it thoroughly...
3,458
Posted By sunpraveen
Giri, Perhaps this post...
Giri,

Perhaps this post (https://www.unix.com/shell-programming-scripting/119196-compare-1st-col-file.html) might help you.


Regards,

Praveen
2,442
Posted By sunpraveen
Seems like your code is working fine, albeit with...
Seems like your code is working fine, albeit with some slight modifications. Try to incorporate the changes and let me know the result.

Your code, modified slightly:

$ cat file2
startdate=1...
4,077
Posted By sunpraveen
Perhaps in awk. But that is unfortunately, not my...
Perhaps in awk. But that is unfortunately, not my forte. :(

awk experts, anyone?

Regards,

Praveen
1,722
Posted By sunpraveen
Which OS are you on? Depending on the OS,...
Which OS are you on?

Depending on the OS, you could build the below logic:

1. Get a list of file systems using "bdf" or "df -k" as the case may be.

2. Get a list of all directories & file...
1,430
Posted By sunpraveen
Alex, 1. if [ ".$t" != . ]; then ...
Alex,


1. if [ ".$t" != . ]; then


The above is basically to check whether the variable $t is set or not. If it is indeed set to some value, then ".$t" will NOT be equal to "."

eg: if...
4,077
Posted By sunpraveen
Try this: INPUT FILE:$ cat file.txt NAME ...
Try this:

INPUT FILE:$ cat file.txt
NAME
ADDRESS
NO
NAME
OTHER
NEW
OP
NAME
FEW
OTHER
NEW
NAME


SHELL SCRIPT:
$ cat file1
grep -n "NAME" file.txt | cut -d ':' -f1 >...
7,918
Posted By sunpraveen
Tuxidow/others, I am also curious to know:...
Tuxidow/others,

I am also curious to know: is there any other way to supply a password to scp apart from ssh equivalence? :confused:


Regards,

Praveen
8,822
Posted By sunpraveen
Can you try something like: 1. Put all the...
Can you try something like:

1. Put all the ip addresses in a file say file1.

2. grep -v "10.10.10" file1

HTH,:cool:

Regards,

Praveen
1,297
Posted By sunpraveen
Try this: cat file_name | while read...
Try this:



cat file_name | while read line
do
echo ${line} | cut -d '_' -f2,3 | cut -d '.' -f1 >> /tmp/test.txt
done

cat tmp/test.txt



HTH,:cool:

Regards,

Praveen
1,363
Posted By sunpraveen
Can't you do a echo to a file like below: ...
Can't you do a echo to a file like below:



echo "awk '{print $1)' input.txt" > /tmp/temp.txt
mailx (or sendmail) < /tmp/temp.txt




Regards,

Praveen
2,648
Posted By sunpraveen
There is no need to use ".sh" to execute a shell...
There is no need to use ".sh" to execute a shell script. You can use just the file name without any extensions.

Try this:



sqlplus -s /nolog << EOF >...
11,746
Posted By sunpraveen
This should work. Of course, "ps -ef | grep pmon"...
This should work. Of course, "ps -ef | grep pmon" is only for testing. Replace it with $i (as in your script).



$ echo "ps -ef | grep pmon" | cut -d '|' -f1
ps -ef
$



HTH,:cool:
...
1,580
Posted By sunpraveen
Simon, Why is it that you want to use imp...
Simon,

Why is it that you want to use imp or exp with sh?

imp is NOT a shell script. It is an executable created using the libraries under $ORACLE_HOME.

Only shell scripts can be run...
3,928
Posted By sunpraveen
Your solution works if the number of words in the...
Your solution works if the number of words in the column USER_PROG_NAME is know. But it is NOT.

It can contain 1, 2 or even 5 words with spaces seperating them. :eek:

So basically what I want...
Showing results 1 to 25 of 93

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