10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I tried to look up the issue i'm experiencing, but i'm confused what's wrong with my script.
After executing the script I'm getting the following error
expr: non-numeric argument
syntax error on line 1, teletype
After some research, it seems that the problem relates to bc.
I have... (1 Reply)
Discussion started by: nms
1 Replies
2. Shell Programming and Scripting
If ($argv == “-debug”) then
Echo “in loop”
Endif
But this is not working. If I modify this code and remove “-“, then it works.
Similarly I am getting problem using grep command also
Grep “-debug” Filename
Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies
3. Shell Programming and Scripting
Hi,
How to return the string "y" to the calling function.
Getting the below error when function returns the value.
return: y: numeric argument required
With Regards (2 Replies)
Discussion started by: milink
2 Replies
4. UNIX for Dummies Questions & Answers
Can someone tell me how to change the first column in a very large 17k line file from a random 10 digit numeric value to a non numeric value. The format of lines in the file is:
1702938475,SNU022,201004
the first 10 numbers always begin with 170 (6 Replies)
Discussion started by: Bahf1s
6 Replies
5. Shell Programming and Scripting
Hi all,
i am facing the error "expr: non-numeric argument" when i use the expr command.
Following is the expression which i want to execute
HR=$(echo `date +%H`)
MIN=$(echo `date +%M`)
TOT_MIN=`expr "$HR" \* 60+$MIN` | bc
echo $TOT_MIN
Here I am being reported with the error expr:... (6 Replies)
Discussion started by: sparks
6 Replies
6. Shell Programming and Scripting
Can someone please help me with this SHELL script?
I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1.
Here is a start but I have no clue how to... (3 Replies)
Discussion started by: I-1
3 Replies
7. UNIX for Dummies Questions & Answers
hi there,
I was recently introduced to this site by a friend. I hope you guys can help with a code error i can't seem to debug.I can get to add two different data types together. A snippet of the code is below:
echo -n "Enter Your MOnthly Investment"
read Inv
PIP= $(echo "scale=2; 10 / 100"... (4 Replies)
Discussion started by: Allenzo
4 Replies
8. Shell Programming and Scripting
Hi All,
Is there any code in Perl which can differentiate between numeric and non-numeric input? (11 Replies)
Discussion started by: Raynon
11 Replies
9. UNIX for Dummies Questions & Answers
quick question, I am trying to run this simple equation
expr 2048 / 2.354
but get a "expr: non-numeric argument" error when ever its run. I believe it may be caused by the decimal point but I do not know how to remedy it. (3 Replies)
Discussion started by: TiredOrangeCat
3 Replies
10. Solaris
I want to figure out what is the reason of error message I have in Solaris 10. Why Solaris 10 dosn't recognize 65535?
ps: 65535 is an invalid non-numeric argument for -p option
usage: ps
'format' is one or more of:
Thank you (5 Replies)
Discussion started by: gogogo
5 Replies
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)