Facing issue with sort command while executing script using ksh

Solution In Progress - Updated -

Issue

  • Getting 'sort' error when running shell script
awk -F"|" -v CHECK_FIELD="6" -v CHECK_FIELD="RTV_U_TY_Ac" '{arr[$1] +=6} END {for (i in arr)  {printf (SUMMATION_FIELD_NAME1"|%1s|%2.2f\n", i, arr[i]) }}' /opt/test/data/check.dat | sort -n -k 0 >> /opt/test/data/check_23

"sort: field number is zero: invalid field specification `0'"
  • Executing a custom script works with bash and ksh in RHEL4 but not ksh in RHEL6
  • Trying to execute script with bash works but when trying to execute script with ksh it is not working

Environment

  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In