Changing script from csh to bash

Hello Guys

I have a script working fine on csh, but I would like to change it to bash, how I should change this command to be able to work as bash script. :wall:

if ( $fsw > "0" ) then

foreach swath ( `awk 'BEGIN {for (i='$fsw';i<='$lsw';i++) printf ("%s\n", i) }'` )

## work to be done

end 
end if

Hello,
Something as:

if [ $fsw -gt 0 ]; then
for swath in $(awk 'BEGIN {for (i='$fsw';i<='$lsw';i++) printf ("%s\n", i) }')
do

## work to be done

done
fi

Regards.

1 Like

Hi disedorgue

It works fine thanks a lot