05-09-2005
Please do not disregard this question, it is for work.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hello....very new user to unix...and i have a question..i am not sure if there is such a thing
For example...the user is asked if he likes Bananas....if he says yes....
echo You like Bananas $name
at the end of the script it echos all that the user has entered so they can read it....
but... (1 Reply)
Discussion started by: jonas27
1 Replies
2. Shell Programming and Scripting
I am running on HPUX using ksh.
I have a script that uses a loop within a loop, for some reason the script seems to hang on a particuliar record. The record is fine and hits the condition in Blue. If I kill the 1st loop process the script continues on with no problem.
Begin code>
<Some... (8 Replies)
Discussion started by: bthomas
8 Replies
3. UNIX for Dummies Questions & Answers
Hi,
how can I use "for" to have two loops :
this is my script :
for i in (A B C)
do
for j in (a b c)
do
echo $i$j
done
done
#End
I want to print out
Aa
Ab
Ac ....
But I have error message :
syntax error at line 1 : `(' unexpected
Many thanks before.
How should I use "for" ?? (2 Replies)
Discussion started by: big123456
2 Replies
4. Shell Programming and Scripting
Hi
I've a file like so:
Now, I want to read my file and take ex. the Media ID and the Type for each groups of Media (Media1,Media2,...,Media(n):
cat /tmp/file|\
while read FILE
do
while $(FILE|cut -d: -f1)=Media$i
do
#here will be some test, ex:
#if Media ID < 23
... (4 Replies)
Discussion started by: nymus7
4 Replies
5. UNIX for Dummies Questions & Answers
I am traversing down a list, and I am not quite sure how to tell the loop to break when it's done going through the file.
#!/bin/sh
while :
do
read list <&3
echo $list
done
is the code. The file "list" is simply
5
4
3
2
1
any advice on how to break the loop after the file is... (1 Reply)
Discussion started by: MaestroRage
1 Replies
6. Shell Programming and Scripting
#!/bin/bash
IFS=$'\n'
A= a c b t g j i e d
B= t y u i o p
counter=0
found=""
for i in $(cat $A)
do
for j in $(cat $B)
do
if
then
found="yes"
fi
done
if
then (1 Reply)
Discussion started by: vadharah
1 Replies
7. Shell Programming and Scripting
Hi All,
I want to execute a script the number of times a user enters. Please can you advise on hor can I do the same.
Many Thanks,
Shazin (4 Replies)
Discussion started by: Shazin
4 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I'm not sure if this is more appropriate for the 'unix for dummies' or the 'unix for experts' forum because I'm new to this forum and this is the second topic I've discussed, but if you could let me know which one was more appropriate for something like this, please do!
So in tr (an... (2 Replies)
Discussion started by: juliette salexa
2 Replies
9. UNIX for Advanced & Expert Users
I'm trying to understand better the while and until loops, can someone help me with this example?
#!/bin/bash
# Listing the planets.
for planet in Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto
do
echo $planet # Each planet on a separate line.
done
echo; echo
for... (3 Replies)
Discussion started by: jose2802
3 Replies
10. UNIX for Dummies Questions & Answers
Why wont my for statements work? Im trying to get this script to swich to a user an if you put in a start/stop/or restart paramater to do just that for each user. I commented out the actual start/stop actions to test it just by using echos and not do anything hasty in the environment but it... (0 Replies)
Discussion started by: LilyClaro
0 Replies
LEARN ABOUT OPENSOLARIS
erruid
ckuid(1) User Commands ckuid(1)
NAME
ckuid, erruid, helpuid, valuid - prompts for and validates a user ID
SYNOPSIS
ckuid [-Q] [-W width] [-m] [-d default] [-h help]
[-e error] [-p prompt] [-k pid [-s signal]]
/usr/sadm/bin/erruid [-W width] [-e error]
/usr/sadm/bin/helpuid [-W width] [-m] [-h help]
/usr/sadm/bin/valuid input
DESCRIPTION
The ckuid utility prompts a user and validates the response. It defines, among other things, a prompt message whose response should be an
existing user ID, text for help and error messages, and a default value (which are returned if the user responds with a RETURN).
All messages are limited in length to 70 characters and are formatted automatically. Any white space used in the definition (including NEW-
LINE) is stripped. The -W option cancels the automatic formatting. When a tilde is placed at the beginning or end of a message definition,
the default text is inserted at that point, allowing both custom text and the default text to be displayed.
If the prompt, help or error message is not defined, the default message (as defined under NOTES) is displayed.
Three visual tool modules are linked to the ckuid command. They are erruid (which formats and displays an error message), helpuid (which
formats and displays a help message), and valuid (which validates a response). These modules should be used in conjunction with FML
objects. In this instance, the FML object defines the prompt.
OPTIONS
The following options are supported:
-d default Defines the default value as default. The default is not validated and so does not have to meet any criteria.
-e error Defines the error message as error.
-h help Defines the help messages as help.
-k pid Specifies that process ID pid is to be sent a signal if the user chooses to abort.
-m Displays a list of all logins when help is requested or when the user makes an error.
-p prompt Defines the prompt message as prompt.
-Q Specifies that quit will not be allowed as a valid response.
-s signal Specifies that the process ID pid defined with the -k option is to be sent signal signal when quit is chosen. If no signal
is specified, SIGTERM is used.
-W width Specifies that prompt, help and error messages will be formatted to a line length of width.
OPERANDS
The following operand is supported:
input Input to be verified against /etc/passwd.
EXIT STATUS
The following exit values are returned:
0 Successful execution.
1 EOF on input, or negative width on -W option, or usage error.
2 Usage error.
3 User termination (quit).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
attributes(5)
NOTES
The default prompt for ckuid is:
Enter the login name of an existing user [?,q]:
The default error message is:
ERROR - Please enter the login name of an existing user.
If the -m option is used, the default error message is:
ERROR: Please enter one of the following login names: <List>
The default help message is:
Please enter the login name of an existing user.
If the -m option is used, the default help message is:
Please enter one of the following login names: <List>
When the quit option is chosen (and allowed), q is returned along with the return code 3. The valuid module will not produce any output. It
returns 0 for success and non-zero for failure.
SunOS 5.11 14 Sep 1992 ckuid(1)