echo output not getting assigned to a variable in shell script
问题 end=echo $FSDB_FILE_NAME | rev | cut -d'_' -f 2 |rev begin=echo $FSDB_FILE_NAME | rev | cut -d'_' -f 3 |rev echo $end echo $begin echo abc_11204.00_15713.00_.csv | rev | cut -d'_' -f 2 |rev ---- This works But echo $end is not printing anything I even tried: set end=echo abc_11204.00_15713.00_.csv | rev | cut -d'_' -f 2 |rev echo $end This prints empty Please help me with this Sample input : abc_123.00_345.00_xyz.csv Output : end=345.00 begin=123.00 回答1: Could you please try following. Easy