DISQUS

Tech-Recipes: Print out only last revision in list of patches | Solaris | Tech-Recipes

  • Anonymous · 4 years ago
    This failed with an awk error on my Solaris 8 system.

    showrev -p | awk -F- '{hold0=$0; hold=$1; while (getline > 0) { if (hold!=$1) {print hold0; hold0=$0} if (hold=$1) hold0=$0 } }'

    Changing the 'awk' to 'nawk' resolved the issue.

    showrev -p | nawk -F- '{hold0=$0; hold=$1; while (getline > 0) { if (hold!=$1) {print hold0; hold0=$0} if (hold=$1) hold0=$0 } }'

    Thanks for the tip.