I have a script /root/asas with following contents.
What I need is when "cat" does not find sandra in /etc/passwd, it should print "Sandra is NOT in /etc/passwd". But this is not giving correct result. See below.
If you just want to print Sandra is NOT in /etc/passwd" then why are you using " echo "variable ha is $ha" in else of your script?
Hello All,
I have a script that will email out if the email address is specified as parameter 1.
I am using ksh, and then tried the following :
email=$1
Following did not work, I am getting error
test -z $email
test ${email:=" ") -eq " "
test -n $email
test ${?email}
What... (4 Replies)
Hi
I am writing a bash script and would like to check is a variable contains a . or not
ex.
a=102 output ok
a=1.02 output not ok
Many thanks, (3 Replies)
Hi all,
to check that a variable is not empty, I usually do:
if ; then...
or
if ; then...
what if I have a serie of variables and want to do the same test on all of them. How to do this in a single if statement?
thank you (1 Reply)
hi to all,
i want to check the value of a variable that it contains characters.
for example i try the following:
if then .........
i just want to check that in the specific line that is a variable called "passline" has the entry "password". But it can contain also other characters in the... (4 Replies)
I have seen many posts for this sort of problem but I just did not know how to use it for my issue. A number is assigned to a variable and I wanted to check if it is a zero or non zero.
Example of my numbers are below:
000000000000000000000000000000000000000000000000... (8 Replies)
#!/bin/sh
echo "Running Script to capture ORACLE Erros"
# Change Directory to the actual logs path
cd /home/nv8510/lognew
err_var=`grep -in "ORA-" *`
if then
echo "THESE ARE THE ORACLE ERROR OCCURED"
echo "$err_var"
echo... (7 Replies)
hi,
i want to check whether a a variable contains some value or is empty in a shell script. so if the variable contains some value i want to do some job and if the variable doesnt contain any value then i need to skip that job.
here is a sample script
read_filenames.sh contains
... (5 Replies)
Hi people,
I would like to start a review of my config variable to check whether they have been changed and if not then there is only an echo. If they have been changed to my other commands are executed.
I hope you can help me.
with best regards
JPad
edit:
here my code
if ;... (8 Replies)
Discussion started by: JPad
8 Replies
LEARN ABOUT OSF1
vipw
vipw(8) System Manager's Manual vipw(8)NAME
vipw - Edits the /etc/passwd file
SYNOPSIS
/usr/sbin/vipw
DESCRIPTION
You use the vipw command to edit the /etc/passwd file with the editor defined in the EDITOR environment variable. If the variable is not
set, the default editor is vi.
The vipw command performs basic consistency checks on the edited file. If a hashed indexed passwd existed previously, the vipw command
uses the mkpasswd command to create recreate it.
The command must not be used on systems that use extended security attributes since it cannot set or change them. You must be root to run
this command. Only root and security administrators should have execute access to this command.
Since the vipw command cannot effectively change all the attributes of users, it should not be used in a secure environment.
The vipw command accesses the following files, and requires the listed permissions:
------------------------------
Permissions File
------------------------------
rw /etc/passwd
rw /etc/passwd.pag
rw /etc/passwd.dir
rw /etc/ptmp
rw /etc/ptmp.pag
rw /etc/ptmp.dir
------------------------------
EXAMPLE
To edit the /etc/passwd file, type the following command and add the required line entry: vipw
FILES
Specifies the command path
RELATED INFORMATION
Commands: passwd(1), passwd(4), adduser(8), mkpasswd(8) delim off
vipw(8)