1

I have a bash command split across multiple lines (toy example):

echo "I like monkeys" > monkeys

awk '{print $3}' monkeys \
| wc \
| sort \
| uniq -c

Is it possible to comment under each line while still allowing the command to run? E.g. the below fails, terminating the command after the awk command.

echo "I like monkeys" > monkeys

awk '{print $3}' monkeys \
# This line prints the word monkeys
| wc \
# This line counts lines, words, and characters
| sort \
# This line essentially does nothing
| uniq -c
# This line adds a 1 to the front of the previous lines
Joni
  • 375
  • 1
  • 11

0 Answers0