I'm getting a count of lines matching a pattern.
This code works:
ACTION_PATTERN='perl$' export ACTION_PATTERN ROWS=$(perl -n -e '$count++ if /$ENV{ACTION_PATTERN}/; END { print $co +unt }' ~/.zsh_history) echo "ROWS:${ROWS}"
Is there a simpler alternative to exporting?
In reply to Calling perl from zsh w/ vars by k-man
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |