09-08-2007
Accepting user input in c shell
i need to accept the user input in my c shell script before executing next command. i have the following code which ask for user input, but does not store this value.
set req
echo " Enter your input(Y/N)?"
read req
if (req = Y)
echo " print $req"
else
echo " print $req"
endif
Where is the problem here. Pl. let me know.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm just starting out with UNIX and have figured some stuff out. I just need some help with accepting user input on the command line. For instance, I created a number counter that counts down from any positive hard coded number. But, I want the commnad line line to read "Countdown 20" where 20... (1 Reply)
Discussion started by: scott78
1 Replies
2. Linux
I'm using Red Hat Linux 3, and the computer has stopped taking input from mouse, keyboard, etc. What are possible causes? How can I fix?
-Worried Linux User (11 Replies)
Discussion started by: lunchtime
11 Replies
3. Shell Programming and Scripting
He guys.
Basically I want to make a script that can add, delete and view stuff in a external file called config.txt. I can open it up in Joe but im not sure how to read in the user input or using commands automatically in joe to edit, save then quit.
Problem area below:
1) echo "Add... (1 Reply)
Discussion started by: Pits
1 Replies
4. Shell Programming and Scripting
hi
I am trying to invoke another application script from my script like
---------------------------
main
.
.
./new appl <<EOF
Input 1
Input 2
EOF
.
.
exit
------------------------
But is exits the new application after input command 2, I want that it should not exit and accept... (1 Reply)
Discussion started by: ashish_uiit
1 Replies
5. UNIX for Dummies Questions & Answers
I how do i accept a input date in script which is lesser than a specified day? ex: to accept a date less than or equal to 100 days(from today).?:(
Thanks for the help in advance.:) (1 Reply)
Discussion started by: abhi_123
1 Replies
6. Shell Programming and Scripting
Is there a way to display the default answer when accepting input from the user in the unix script..
e.g.
ans="n"
read $ans?"Enter y to continue n to exit:"
altough ans contains n the message doesn't display the current contents on ans .. you get
Enter y to continue n to exit: (8 Replies)
Discussion started by: flopster
8 Replies
7. Shell Programming and Scripting
basically im trying to promt the user to create a name for a file then send the file name to a file with the list of the file names he has created. Also i want to code if the user doesnt enter any text to just print "Default Folder"
so far my code looks like:
if
then
echo "create `$1`... (1 Reply)
Discussion started by: bravens52
1 Replies
8. Shell Programming and Scripting
Hi All,
Can we pass arguments while calling the perl script and as well as ask user input during execution of the script?
My program is as below:
I am passing arg1 and arg2 as argements to test.pl
]./test.pl arg1 arg2
Inside the test.pl I have :
print "Do you want a name ? (y/n) : ";... (2 Replies)
Discussion started by: jisha
2 Replies
9. Shell Programming and Scripting
Hi I am trying to get my script to accept input regardless if the person enters a or A. here is the portion of the code where I get the input.
echo -n 'Please enter your choice:' # prompt user for input.
read reply # read input
echo
case $reply in #... (2 Replies)
Discussion started by: DualPandas
2 Replies
10. Solaris
Ran into this issue today and wanted to share how I fixed it as there is not a lot a lot of info online on this issue.
We upgraded our NetApp controllers to Ontap 9 and reboot all our iSCSI attached LDOMs after. One of the LDOM did not come up cleanly and it would not accept any keyboard inputs... (0 Replies)
Discussion started by: ncherukuri
0 Replies
LEARN ABOUT CENTOS
strongimcv_pki---req
PKI --REQ(1) strongSwan PKI --REQ(1)
NAME
pki --req - Create a PKCS#10 certificate request
SYNOPSIS
pki --req [--in file] [--type type] --dn distinguished-name [--san subjectAltName] [--password password] [--digest digest]
[--outform encoding] [--debug level]
pki --req --options file
pki --req -h | --help
DESCRIPTION
This sub-command of pki(1) is used to create a PKCS#10 certificate request.
OPTIONS
-h, --help
Print usage information with a summary of the available options.
-v, --debug level
Set debug level, default: 1.
-+, --options file
Read command line options from file.
-i, --in file
Private key input file. If not given the key is read from STDIN.
-t, --type type
Type of the input key. Either rsa or ecdsa, defaults to rsa.
-d, --dn distinguished-name
Subject distinguished name (DN). Required.
-a, --san subjectAltName
subjectAltName extension to include in request. Can be used multiple times.
-p, --password password
The challengePassword to include in the certificate request.
-g, --digest digest
Digest to use for signature creation. One of md5, sha1, sha224, sha256, sha384, or sha512. Defaults to sha1.
-f, --outform encoding
Encoding of the created certificate file. Either der (ASN.1 DER) or pem (Base64 PEM), defaults to der.
EXAMPLES
Generate a certificate request for an RSA key, with a subjectAltName extension:
pki --req --in key.der --dn "C=CH, O=strongSwan, CN=moon"
--san moon@strongswan.org > req.der
Generate a certificate request for an ECDSA key and a different digest:
pki --req --in key.der --type ecdsa --digest sha256
--dn "C=CH, O=strongSwan, CN=carol" > req.der
SEE ALSO
pki(1)
5.1.1 2013-07-31 PKI --REQ(1)