How to write this condition in ksh?
if myfile is empty or myfile does not exist
then
do action1
fi
is this OK?
if ] -o ] then
then
do action1
fi
Thanks. (3 Replies)
Hi,
Plz suggest me how can i change the date of a file.
Suppose my file has been created in some date and i want to give it present date.
How can i do this???? (2 Replies)
hi all,
i want use the variable value as a new variable name. print output of new variable.
for i in COMPUTER1 COMPUTER2
do
flag_name=${i}_FLAG
eval ${flag_name}=123
echo $i'_FLAG'
done
output is
COMPUTER1_FLAG
COMPUTER2_FLAG
i need output as
123
123 (2 Replies)
Apologies for the utter triviality of this question, but we all have to start somewhere! I've also tried searching but this question is pretty vague so I didn't (a) really know what to search for or (b) get many relevant hits to what I did search for.
Anyway, I'm in the process of self-teaching... (1 Reply)
Hi.
How to change string variable in awk?
for example, I parse with awk script text file named some_name_with_extension.txt
I want to print only some_name in my script
....
varCompName = FILENAME
print varCompName
How to put not all symbols from FILENAME to variable?
thank you
This... (4 Replies)
Hey Guys,
I have text such as this.
28003,ALCORN,2
28009,BENTON,2
28013,CALHOUN,2
28017,CHICKASAW,2
47017,CARROLL,2
05021,CLAY,0
The last digit after the final "," is a variable value. This is the base file. I have to do further execution on this file later and I need to update the... (7 Replies)
I feel like it is just a matter of using the $ operators correctly, but I can't seem to get it...
hostname="network"
ip="192.168.1.1"
netmask=""
variables=( $hostname $ip $netmask )
for var in ${variables}
do
if ; then
$var="--"
fi
done
echo... (7 Replies)
Hi,
This is the first time I see something like this, and I don't why it happens.
Please give me some help. I am really appreciate it.
Basically I am trying to remove all empty lines of an input..
#!/bin/bash
set -e
set -x
str1=`echo -e "\nhaha" | grep -v ^$`
#str2=`echo -e "\n" |... (4 Replies)
I have a file hello.txt which was created today (today's date timestamp)
I wish to change its date timestamp (access, modified, created) to 1 week old i.e one week from now.
uname -a
SunOS mymac 5.11 11.2 sun4v sparc sun4v
Can you please suggest a easy way to do that ? (12 Replies)
Discussion started by: mohtashims
12 Replies
LEARN ABOUT REDHAT
ypchfn
yppasswd(1) General Commands Manual yppasswd(1)NAME
yppasswd, ypchfn, ypchsh - change your password in the NIS database
SYNOPSIS
yppasswd [-f] [-l] [-p] [user]
ypchfn [user]
ypchsh [user]
DESCRIPTION
The standard passwd(1), chfn(1) and chsh(1) cannot be used under Linux to change the users NIS password, shell and GECOS information,
because they only modify the password file on the local host. For changing the NIS information, they are replaced by their NIS counter-
parts, yppasswd, ypchfn and ypchsh.
These commands are the same program, linked to different names. Using the command line switches, you can choose whether to update your
password -p, your login shell -l, or your GECOS field -f, or a combination of them. yppasswd implies the -p option, if no other option is
given. If you use the -f or -l option, you also need to add the -p flag. ypchfn implies the -f option, and ypchsh -l.
When invoked without the user argument, the account information for the invoking user will be updated, otherwise that of user will be
updated. This option is only available to the super-user. If the yppasswdd daemon on the server supports it, you can give the root password
of the server instead of the users [old] password.
All tools will first prompt the user for the current NIS password needed for authentication with the yppasswdd(8) daemon. Subsequently, the
program prompts for the updated information:
yppasswd or -l
Change the user's NIS password. The user is prompted for the new password. While typing the password, echoing is turned off, so
the password does not appear on the screen. An empty password is rejected, as are passwords shorter than six characters. The user
will then be requested to retype the password to make sure it wasn't misspelled the first time.
ypchsh or -l
Change the user's login shell. The user is prompted for a new shell, offering the old one as default:
Login shell [/bin/sh]: _
To accept the default, simply press return. To clear the shell field in your passwd(5) file entry (so that the system's default
shell is selected), enter the string none.
ypchfn or -f
Change the user's full name and related information. Traditionally, some applications expect the GECOS field (field 4) of the
passwd(5) file to contain the user's real name (as opposed to the login name) plus some additional information like the office phone
number. This information is displayed by finger(1) and probably some other tools, too.
When setting the full name, ypchfn displays the following prompts, with the defaults in brackets:
Name [Joe Doe]:
Location [2nd floor, bldg 34]:
Office Phone [12345]:
Home Phone []:
To accept a default, simply press return. To clear a field, enter the string none.
SEE ALSO chfn(1), chsh(1), finger(1), passwd(5), passwd(1), ypcat(1), yppasswdd(8), ypserv(8), ypwhich(1)AUTHOR
yppasswd is part of the yp-tools package, which was written by Thorsten Kukuk <kukuk@suse.de>.
YP Tools 2.7 May 1998 yppasswd(1)