Here is my shell script
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
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
and that I get same output "Your name is:first and your surname is:last" .. Thank you for your answers
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT DEBIAN
escape
escape(1) Mail Avenger 0.8.3 escape(1)NAME
escape - escape shell special characters in a string
SYNOPSIS
escape string
DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result.
EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string:
$ var='; echo gotcha!'
$ eval echo hi $var
hi
gotcha!
$
Using escape, one can avoid executing the contents of $var:
$ eval echo hi `escape "$var"`
hi ; echo gotcha!
$
A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For
example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient:
#!/bin/sh
formail -x to -x cc -x resent-to -x resent-cc
| fgrep "$1" > /dev/null
&& exit 0
echo "<$1>.. address does not accept blind carbon copies"
exit 100
To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt
script:
bodytest reject_bcc `escape "$RECIPIENT"`
SEE ALSO avenger(1),
The Mail Avenger home page: <http://www.mailavenger.org/>.
BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells.
AUTHOR
David Mazieres
Mail Avenger 0.8.3 2012-04-05 escape(1)