I can't get my function to do what I want. When I call my function get_from_A_to_F I give it an argument $remainder. I want my function to substitute a number higher than 9 to a specific letter. If the argument is equal to 10 than it should change it to "A". However it still leaves it as a 10. What am I doing wrong here?
cat .servers | while read LINE; do
ssh jason@$LINE $1
done
exit 1
./command.ksh "ls -l ~jason"
Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing?
Thanks!
JP (2 Replies)
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Hi!
I have 2 servers. The firts has vsftpd server with this configuration:
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all... (2 Replies)
I have a script which uses below for loop:
for (( i = 0 ; i <= 5; i++ ))
do
echo "Welcome $i times"
done
But when I run the script, it gives error message:
Syntex Error : Bad for loop variable
Can anyone guide to run it?
Thanks in advance. (10 Replies)
Hi
I have put alias ll='ls -la' in .profile file but it doesn't work.
On hand it works it looks like the .profile file is not beeing read.
How to check whitch file is loaded? ,profile? .bash_profile?
My system: SunOS mion 5.10 Generic
Shell: /bin/pfksh
Thanks (2 Replies)
Hi,when I run my first shell script,I got something that doesn't work right.
I wrote this code in the script.
echo -e "Hello,World\a\n"But the screen print like this:
-e Hello,World
The "-e" wasn't supposed to be printed out.
Can anyone help me out?:wall:
Many thanks!:) (25 Replies)
I'm working on AIX 6, ksh shell. The parameters are some strings quotated by double quotation marks which from a file. They are quotated because there may be spaces in them.
Example:
"015607" "10" " " "A"I want to pass these parameters to a shell function by writing the following command:
... (4 Replies)
greetings,
the following code isn't working as i expect it to. the first dbl brackets do but the second set gets ignored. ie: if i'm on t70c6n229 it echoes "Something" and i expect it not to. what am i missing?
if " ]] || " ]]; then
echo "Something"
fi
thanx! (9 Replies)
Hi,
I am using korn shell.
until ]
do
echo "\$# = " $#
echo "$1"
shift
done
To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work.
Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies
LEARN ABOUT SUNOS
fmlexpr
fmlexpr(1F) FMLI Commands fmlexpr(1F)NAME
fmlexpr - evaluate arguments as an expression
SYNOPSIS
fmlexpr arguments
DESCRIPTION
The fmlexpr function evaluates its arguments as an expression. After evaluation, the result is written on the standard output. Terms of the
expression must be separated by blanks. Characters special to FMLI must be escaped. Note that 30 is returned to indicate a zero value,
rather than the null string. Strings containing blanks or other special characters should be quoted. Integer-valued arguments may be pre-
ceded by a unary minus sign. Internally, integers are treated as 32-bit, 2s complement numbers.
The operators and keywords are listed below. Characters that need to be escaped are preceded by . The list is in order of increasing
precedence, with equal precedence operators grouped within {} symbols.
USAGE
Expressions
expr | expr
Returns the first expr if it is neither NULL nor 0, otherwise returns the second expr.
expr & expr
Returns the first expr if neither expr is NULL or 0, otherwise returns 0.
expr { =, >, >=, <, <=, != } expr
Returns the result of an integer comparison if both arguments are integers, otherwise returns the result of a lexical comparison.
expr { +, - } expr
Addition or subtraction of integer-valued arguments.
expr { *, /, % } expr
Multiplication, division, or remainder of the integer-valued arguments.
expr : expr
The matching operator : (colon) compares the first argument with the second argument which must be a regular expression. Regular
expression syntax is the same as that of ed(1), except that all patterns are "anchored" (that is, begin with ^) and, therefore, ^ is
not a special character, in that context. Normally, the matching operator returns the number of bytes matched (0 on failure). Alterna-
tively, the (...) pattern symbols can be used to return a portion of the first argument.
EXAMPLES
Example 1: Incrementing a variable
Add 1 to the variable a:
example% fmlexpr $a + 1 | set -l a
Example 2: Setting a variable equal to a filename
For $a equal to either /usr/abc/file or just file:
example% fmlexpr $a : .*/(.*) | $a
returns the last segment of a path name (that is, file). Watch out for / alone as an argument: fmlexpr will take it as the division opera-
tor (see NOTES below).
Example 3: A better representation of Example 2
example% fmlexpr //$a : .*/(.*)
The addition of the // characters eliminates any ambiguity about the division operator (because it makes it impossible for the left-hand
expression to be interpreted as the division operator), and simplifies the whole expression.
Example 4: Counting characters in a variable
Return the number of characters in $VAR:
example% fmlexpr $VAR : .*
EXIT STATUS
As a side effect of expression evaluation, fmlexpr returns the following exit values:
0 if the expression is neither NULL nor 0 (that is, TRUE)
1 if the expression is NULL or 0 (that is, FALSE)
2 for invalid expressions (that is, FALSE).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO ed(1), expr(1), set(1F), sh(1), attributes(5)DIAGNOSTICS
syntax error for operator/operand errors
non-numeric argument if arithmetic is attempted on such a string
In the case of syntax errors and non-numeric arguments, an error message will be printed at the current cursor position. Use refresh to
redraw the screen.
NOTES
After argument processing by FMLI, fmlexpr cannot tell the difference between an operator and an operand except by the value. If $a is an
=, the command:
example% fmlexpr $a = =
looks like:
example% fmlexpr = = =
as the arguments are passed to fmlexpr (and they will all be taken as the = operator). The following works, and returns TRUE:
example% fmlexpr X$a = X=
SunOS 5.10 5 Jul 1990 fmlexpr(1F)