Sponsored Content
Full Discussion: shell script with input
Top Forums Shell Programming and Scripting shell script with input Post 302213197 by c0mrade on Wednesday 9th of July 2008 12:29:10 PM
Old 07-09-2008
shell script with input

Hi all,

Here is my shell script
Code:
#!/bin/sh
echo "What is your name"
read name
echo "What is your surname"
read surname

echo "Your name is:${name} and your surname is:${surname}"

How can I modify this script so that I input those two variables from console?Lets say my name is "first" and my surname is "last" . So when I run my script
Code:
./script.sh

and input first and last I get "Your name is:first and your surname is:last". Is it possible to modify the script so that it runs like this
Code:
./script.sh first last

and that I get same output "Your name is:first and your surname is:last" .. Thank you for your answers
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

single input shell script?

hey, i'm trying to write a shell script which accepts: operand operator operand then, the script would see which operator it is (using case) and calculate it... but i dont know how to do it correctly with $1 $2 $3... (eliminating accepting separate inputs) (1 Reply)
Discussion started by: quipy
1 Replies

2. UNIX for Dummies Questions & Answers

Masking input in a shell script

How do I prevent user input from being displayed in running script (e.g. when entering a password)? Thanx, Aaron (2 Replies)
Discussion started by: Spetnik
2 Replies

3. UNIX for Dummies Questions & Answers

Shell script with input parameter

Can anyone help me how to write a shell script which accepts input parameter. My requirement is as follows: I need to run a shell script with a input parameter, and inside the script i will create a file with this input parameter name. Please help me out to create such a shell script. ... (1 Reply)
Discussion started by: jhmr7
1 Replies

4. Shell Programming and Scripting

Input to shell script

Hi, I have 10 database instances runnning in one unix box. To connect to each database..i have to set the environment. I am trying to write a shell script to set my environment for database by just tying the oracle instance name After logging into the unix machine... i want to type the... (3 Replies)
Discussion started by: castlerock
3 Replies

5. Shell Programming and Scripting

Shell script getting input from output

I have a program that can be run in terminal, when its run it either returns SSH OK or CRITICAL, how do i use the output in my script? good ./check_sh myserver SSH OK bad ./check_sh myserver CRITICAL I want to store it in a variable btw, SSH OK will give the variable $SSH=1 and if its... (1 Reply)
Discussion started by: aspect_p
1 Replies

6. UNIX for Dummies Questions & Answers

How to take input from excel for shell script.

i have both linux and windos installed on my pc . i want to take 1st column of excel as in input for my shell script .can anyone tell me how can i achive that. (1 Reply)
Discussion started by: nitin_aaa27
1 Replies

7. Shell Programming and Scripting

Input in shell script

Hello! Need help with the following: #!/bin/bash streamripper http://mp3-live.swr.de/swr2_m.m3u -D ~/RadioMitschnitt -l 200 > /dev/null 2>&1 I want to change the script so that it asks for an input for "-l 200" (means length 200sec) and starts then with the new value for "-l". Can I do this... (2 Replies)
Discussion started by: urug3170
2 Replies

8. Shell Programming and Scripting

User Input Shell Script

Hello I am trying to create a user input shell scipt. The objective is user should enter the circuit number and the input is saved in a log file. If the user does not enter anything then the question should prompt it until the circuit no. is entered. Can any one please correct the code below.... (3 Replies)
Discussion started by: sureshcisco
3 Replies

9. Shell Programming and Scripting

Shell script password input

hy, I wrote a simple shell script to monitor (with Nagios) a SNX VPN function. Here the Code snippet: testing=`ssh user@IP-address 'ls /etc/sysconfig/network-scripts/ifcfg-eth0'` #echo $testing if ; then echo "VPN is working" exit 0 else snx -s server -u user ... (2 Replies)
Discussion started by: tomies
2 Replies

10. Shell Programming and Scripting

Read input in shell script

I want to write a script that read the input to variable. I want the input screen to have 2 lines, where the values already input will appear above the input line for example if I want to input the words below: like love live life The screen will display like this: 1. Before any input... (8 Replies)
Discussion started by: aydj
8 Replies
SHIB-METAGEN(1) 						    Shibboleth							   SHIB-METAGEN(1)

NAME
shib-metagen - Generate metadata for a Shibboleth SP SYNOPSIS
shib-metagen [-12ADLNO] [-c cert [-c cert ...]] [-e entity-id] [-f format [-f format ...]] [-h host [-h host ...]] [-n host [-n host ...]] [-o organization] [-a admin [-a admin ...]] [-s support [-s support ...]] [-t tech [-t tech ...]] [-u url] DESCRIPTION
Generate metadata for a Shibboleth SP. The metadata is printed to standard output. Most of the parameters are optional, but at least one of -h or -n must be given to specify the hostname to use in constructing URLs for the Shibboleth service for the SP. Other metadata can be added by using the other command-line parameters. Most parameters can be given multiple times. OPTIONS
-1 Generate SAML 1.0 metadata. The default, if neither -1 nor -2 is given, is to generate metadata for both SAML 1.0 and SAML 2.0. -2 Generate SAML 2.0 metadata. The default, if neither -1 nor -2 is given, is to generate metadata for both SAML 1.0 and SAML 2.0. -A Include artifact metadata. -a admin An administrative contact for this Shibboleth SP. This option may be omitted, in which case administrative contact metadata is not included, or may be given multiple times to list multiple contacts. admin should be in the form "first/last/email" where first is the given name and last is the surname. -c cert Specifies the SSL certificate used to identify this Shibboleth SP. This option may be given multiple times to specify multiple certificates. If it is not given, the default certificate is sp-cert.pem in the current working directory. -D Include discovery service information in the metadata. By default, discovery service information is not included. -e entity-id The entity ID for this SP. This must be a unique identifier for this SP and must be a URL. If -o is given and -u is not given, entity-id is used as the URL for the organization running this Shibboleth SP. If it is not specified, it defaults to "https://host/shibboleth" where host is the argument to the first -h option. -f format Include this NameIDFormat in the metadata. This option may be given more than once. -h host A hostname for this SP (possibly a virtual host). Either this option or -n must be specified at least once. It should be repeated for every virtual host that responds to the Shibboleth protocol. -h should be used for hostnames or virtual hosts that use SSL. -L Include Single Logout information in the metadata. This is not included by default. -N Include NameID management information in the metadata. This is not included by default. -n host A hostname for this SP (possibly a virtual host). Either this option or -h must be specified at least once. It should be repeated for every virtual host that responds to the Shibboleth protocol. -n should be used for hostnames or virtual hosts that do not use SSL to protect the Shibboleth communication. -O Include XML namespace declarations in the generated metadata. This is the default. -o organization The name of the organization that runs this Shibboleth SP. This option may be given only once and may be omitted, in which case organization metadata is not included. This is normally not necessary but may be used by other software systems for purposes such as displaying lists of entities with human-readable names. -s support A support contact for this Shibboleth SP. This option may be omitted, in which case support contact metadata is not included, or may be given multiple times to list multiple contacts. support should be in the form "first/last/email" where first is the given name and last is the surname. -t tech A technical contact for this Shibboleth SP. This option may be omitted, in which case technical contact metadata is not included, or may be given multiple times to list multiple contacts. tech should be in the form "first/last/email" where first is the given name and last is the surname. -u url Sets the URL for the organization. This information is only used if the -o option is also given to specify the name of the organization. If -o is given and -u is not given, the entity ID (set with -e) is used as the organization URL. AUTHOR
This manual page was written by Russ Allbery for Debian GNU/Linux. COPYRIGHT
Copyright 2009, 2011 Russ Allbery. This manual page is hereby placed into the public domain by its author. 2.4.3 2012-02-16 SHIB-METAGEN(1)
All times are GMT -4. The time now is 10:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy