I want to do image processing with gdal and ubuntu shell script

Solution for I want to do image processing with gdal and ubuntu shell script
is Given Below:

[Code is here…]
https://i.stack.imgur.com/KgoW8.png
I want to image processing with gdal and shell script, Multiple raster image

pan=$(ls *-PAN.tiff)
mux=$(ls *-MUX.tiff)
for i in *.tiff
do
 if ["$i" == "$pan"] || ["$i" == "$mux"]
 then  #echo '$pan'
       #echo '$mux'
       gdalwarp -wo "SAMPLE_GRID=NO" -et 0 -rpc -to RPC_DEM=./DEM_30M.tif  $mux ortho_$mux
       gdalwarp -wo "SAMPLE_GRID=NO" -et 0 -rpc -to RPC_DEM=./DEM_30M.tif  $pan ortho_$pan
       gdalwarp -t_srs "EPSG:4326"  -dstalpha ortho_$pan of_$pan
       echo 'of_$pan'
       gdalwarp -t_srs "EPSG:4326"  -dstalpha ortho_$mux of_$mux
       echo 'of_$mux'
       gdal_pansharpen.py  -b 1 -b 2 -b 3 of_$pan of_$mux pansharpened_$pan
       gdalwarp -t_srs "EPSG:4326"  -dstnodata 0 -dstalpha -of Gtiff pansharpened_$pan nob_pansharpened_$pan
 else
       echo 'Not similiar'
 fi
done