Hi all,
In a while loop, like below...
while read line
do
read choice
case $choice in
1)
echo "xxx"
esac
done < file
why I can't run the read choice???? (3 Replies)
Hi Gurus
I have a file called /tmp/CMDB which looks like this
serial: 0623AN1208
hostname: server1
model: x4100
assetID: 1234
I am writing a for loop that will go through this file line by line creating a variable of itself. Using the first iteration of the loop (i.e. the first line) as... (6 Replies)
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Hi,
im having problem creating a loop using my code: aside from the fact that the 1st variable (VAR) does not increment, it loops more than the expected output.
for sample purposes, test csv contains 3 lines.
#get number of lines in the file
lines=$( wc -l < test.csv )
... (5 Replies)
Hi,
The requirement is to ssh to unix servers and oracle databases, to perform some monitoring activity. I'm using shell script to perfom this.
I pass the server details and database to a variable ...
SERVERS="SERVER1 SERVER2 SERVER3"
DATABASE="DB1 DB2 DB3"
for i in $SERVERS
do
ssh... (2 Replies)
Hi,
I am using su within a for loop. As you might expect, it prompts for password during each loop execution. Here is my piece of code:
for i in $LIST
do
if
then
DATABASE=`echo $i | awk -F "|" '{ print $1 }'`
USER_ID=`echo $i | awk -F "|" '{ print $2 }'`
su - apstage -c... (1 Reply)
Hi all
Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Hi,
I am having a file like,
#cat file
Jun 19 13:08
Jun 19 13:08
Jun 19 13:08
Jun 19 13:14
when I run the below comamnd locally it will work fine,
IFS=$'\n'; for i in $(cat file) ;do echo "HI $i" ; done
And the output is,
HI Jun 19 13:08
HI Jun 19 13:08
HI Jun 19 13:08
HI... (1 Reply)
I'm taking a unix class and need to countdown to 0 from whatever number the user inputs. I know how to do this with a while or until loop but using the for loop is throwing me off....
I know I can use an if-then statement in my for loop but can I include a while loop in my for loop? (3 Replies)
I have a XML file of little huge size. I have to build a logic to get the count of the tag <capacity>.
And have an if loop such that all the <capacity> blocks are captured one after the other.
sample input file - sample1.xml
<subcolumns><capacity><name>45.90</name>
<index>0</index>... (1 Reply)
Discussion started by: ramprabhum
1 Replies
LEARN ABOUT FREEBSD
cpasswd
CPASSWD(1) BSD General Commands Manual CPASSWD(1)NAME
cpasswd -- scramble passwords for csup authentication
SYNOPSIS
cpasswd clientName serverName
DESCRIPTION
The cpasswd utility creates scrambled passwords for the CVSup server's authentication database. It is invoked with a client name and a
server name. ClientName is the name the client uses to gain access to the server. By convention, e-mail addresses are used for all client
names, e.g., 'BillyJoe@FreeBSD.org'. Client names are case-insensitive.
ServerName is the name of the CVSup server which the client wishes to access. By convention, it is the canonical fully-qualified domain name
of the server, e.g., 'CVSup.FreeBSD.ORG'. This must agree with the server's own idea of its name. The name is case-insensitive.
To set up authentication for a given server, one must perform the following steps:
1. Obtain the official serverName from the administrator of the server or from some other source.
2. Choose an appropriate clientName. It should be in the form of a valid e-mail address, to make it easy for the server administrator to
contact the user if necessary.
3. Choose an arbitrary secret password.
4. Run cpasswd, and type in the password when prompted for it. The utility will print out a line to send to the server administrator, and
instruct you how to modify your $HOME/.csup/auth file. You should use a secure channel to send the line to the server administrator.
Since $HOME/.csup/auth contains passwords, you should ensure that it is not readable by anyone except yourself.
FILES
$HOME/.csup/auth Authentication password file.
SEE ALSO csup(1), cvsup(1), cvsupd(8).
http://www.cvsup.org/
AUTHORS
Petar Zhivkov Petrov <pesho.petrov@gmail.com> is the author of cpasswd, the rewrite of cvpasswd. John Polstra <jdp@polstra.com> is the
author of CVSup.
LEGALITIES
CVSup is a registered trademark of John D. Polstra.
FreeBSD June 27, 2007 FreeBSD