0

I am new in qshell and would like to ask for assistance. I am trying to get the file count inside an IFS directory using below qshell command.

if(ls <<path>> | wc -l) -gt 0;                    
then echo correct;                                                
fi  

however im getting this error "token word not expected, expecting token "then". TIA

John Y
  • 14,123
  • 2
  • 48
  • 72
user3490590
  • 17
  • 2
  • 9

1 Answers1

1

The below snippet should work for you

if test $(ls <<path>> | wc -l) -gt 0;
then echo correct;
fi

test is used to check the condition, and $() executes the command present inside

Tamil Selvan V
  • 436
  • 3
  • 7