11-12-2008
Quote:
One question... Even after creating the entry in .netrc, i need to specify password in shell script. So what is the purpose the .netrc file now? I thought, we don't need to specify the password when we have entry in .netrc file. But my assumption is wrong.
So we are not hiding the password in shell script. What is use of .netrc file here. Can you please help me understand..
I too had the same question few days back.
Googled it, but dint find anything useful.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Dear All
I have file a.sql, let's say the content is:
_________________________________
select * from dual;
exit;
_________________________________
and I have shell script a.sh, the content is:
_________________________________
ORACLE_SID=testing; export ORACLE_SID... (0 Replies)
Discussion started by: Aditya Purwanto
0 Replies
2. Shell Programming and Scripting
How to stop the Prstat using shell script ?
because after i run the below script the thing seems to be always in loop and cannot get out till i ctrl + c, is there anything that i can add in the script to make it terminate ?
<code>
#!/bin/sh
prstat -Tc -u testing > testing.txt
</code>
... (19 Replies)
Discussion started by: filthymonk
19 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I am writing a bash shell script. How can I tell it to stop. For example, I would like to have something similar to the following:
mike=1
if ; then
STOP THE SCRIPT
fi (3 Replies)
Discussion started by: msb65
3 Replies
4. Shell Programming and Scripting
Hi
I have a script, which i ran in background, can someone please help in stopping this.
i gave this command:
ksh abc.ksh &
this script sends me a mail every 30 seconds. i have deleted the script but still i am getting the mails. can some one please help me stopping dese.
... (3 Replies)
Discussion started by: Prateek007
3 Replies
5. Shell Programming and Scripting
Hi Friends.
I am new to scripting now i want to change the root password using the script with standard password.
which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies
6. Shell Programming and Scripting
Hi, I have googled for quite some time and couldn't able to get what exactly I am looking for.. My query is "how to stop a shell script which is running inside a remote server, using a script"??? can any one give some suggestions to sort this out. (1 Reply)
Discussion started by: mannepalli
1 Replies
7. Shell Programming and Scripting
Hi All,
I would like to develop a shell script for stop & start an application server (1-4) on Solaris box. Here are the user requirements for this task.
1. User will input the option which server they wish to stop.
2. Will clear cache files from specific location.
3. ... (1 Reply)
Discussion started by: venga
1 Replies
8. Shell Programming and Scripting
Hi guys, I've found two nifty little scripts on these forums one which detects if the F5 key has been pressed:
#/bin/sh
_key()
{
local kp
ESC=$'\e'
_KEY=
read -d '' -sn1 _KEY
case $_KEY in
"$ESC")
while read -d '' -sn1 -t1 kp
do
_KEY=$_KEY$kp
... (0 Replies)
Discussion started by: rich@ardz
0 Replies
9. Shell Programming and Scripting
Hi,
I am running a schedular script which will check for a specific time and do the job. I wanted to run this continuously. Meaning even after the if condition is true and it executes the job, it should start running again non stop.
I am using below script
#!/bin/sh
start:
while true
do... (10 Replies)
Discussion started by: sandeepcm
10 Replies
10. Shell Programming and Scripting
Hi folks,
I am running a shell script it asks for username and password to stop some service, I need to write some script that it will read username and password from my shell script and then sucessfully stop services without prompting username/password query. (13 Replies)
Discussion started by: learnbash
13 Replies
LEARN ABOUT DEBIAN
net::netrc
Net::Netrc(3perl) Perl Programmers Reference Guide Net::Netrc(3perl)
NAME
Net::Netrc - OO interface to users netrc file
SYNOPSIS
use Net::Netrc;
$mach = Net::Netrc->lookup('some.machine');
$login = $mach->login;
($login, $password, $account) = $mach->lpa;
DESCRIPTION
"Net::Netrc" is a class implementing a simple interface to the .netrc file used as by the ftp program.
"Net::Netrc" also implements security checks just like the ftp program, these checks are, first that the .netrc file must be owned by the
user and second the ownership permissions should be such that only the owner has read and write access. If these conditions are not met
then a warning is output and the .netrc file is not read.
THE .netrc FILE
The .netrc file contains login and initialization information used by the auto-login process. It resides in the user's home directory.
The following tokens are recognized; they may be separated by spaces, tabs, or new-lines:
machine name
Identify a remote machine name. The auto-login process searches the .netrc file for a machine token that matches the remote machine
specified. Once a match is made, the subsequent .netrc tokens are processed, stopping when the end of file is reached or an- other
machine or a default token is encountered.
default
This is the same as machine name except that default matches any name. There can be only one default token, and it must be after all
machine tokens. This is normally used as:
default login anonymous password user@site
thereby giving the user automatic anonymous login to machines not specified in .netrc.
login name
Identify a user on the remote machine. If this token is present, the auto-login process will initiate a login using the specified
name.
password string
Supply a password. If this token is present, the auto-login process will supply the specified string if the remote server requires a
password as part of the login process.
account string
Supply an additional account password. If this token is present, the auto-login process will supply the specified string if the remote
server requires an additional account password.
macdef name
Define a macro. "Net::Netrc" only parses this field to be compatible with ftp.
CONSTRUCTOR
The constructor for a "Net::Netrc" object is not called new as it does not really create a new object. But instead is called "lookup" as
this is essentially what it does.
lookup ( MACHINE [, LOGIN ])
Lookup and return a reference to the entry for "MACHINE". If "LOGIN" is given then the entry returned will have the given login. If
"LOGIN" is not given then the first entry in the .netrc file for "MACHINE" will be returned.
If a matching entry cannot be found, and a default entry exists, then a reference to the default entry is returned.
If there is no matching entry found and there is no default defined, or no .netrc file is found, then "undef" is returned.
METHODS
login ()
Return the login id for the netrc entry
password ()
Return the password for the netrc entry
account ()
Return the account information for the netrc entry
lpa ()
Return a list of login, password and account information fir the netrc entry
AUTHOR
Graham Barr <gbarr@pobox.com>
SEE ALSO
Net::Netrc Net::Cmd
COPYRIGHT
Copyright (c) 1995-1998 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
perl v5.14.2 2010-12-30 Net::Netrc(3perl)