Search Results

Search: Posts Made By: sheelscripter
1,941
Posted By sheelscripter
Thanks that worked. However I thought "echo" also...
Thanks that worked. However I thought "echo" also did the return and an explicit return was not needed, as in this script:
#!/bin/sh

func()
{

echo 1

}

echo " The result is :"...
30,351
Posted By sheelscripter
to use 'or' in if in bash or bourne , do this: ...
to use 'or' in if in bash or bourne , do this:

if [ blah ] || [ blah ] || [ blah ]; then
blah blah blah

fi
1,941
Posted By sheelscripter
Still getting an error
I modified the script to:


#!/bin/sh

fact()
{

if [ $1 -gt 1 ] ; then

res=`expr $1 - 1`
p=`fact $res`
else
echo $1
...
1,941
Posted By sheelscripter
Whats the error in this script ?
Can someone help me figure out the error with this simple script:


#!/bin/sh

fact()
{


if [ $1 -gt 1 ] ; then

p=`fact expr $1 - 1`
else
...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 09:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy