The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-23-2009
gio001 gio001 is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 70
if format in functions

Hi everyone,
I am receiving this error:
0403-057 Syntax error at line 6 : `}' is not expected.
when I try to enter in my function an if condition of the form:
#! /bin/ksh
do_t(){
var1="testing";recompr=0;
[[ $1 -eq 1 ]] && {printit=0;F_N_s="testing""."xx"."yy;}
}
do_t 1
###########

Am I not doing this right?
if I replace the if with the other format i.e.
if [[ $1 -eq 1 ]];then printit=0;F_N_s="testing""."xx"."yy;fi
it works fine
Please let me know.
Thanks!