#!/bin/bashtemp='1 1 1 1 1 -1 -1 -1 -1 -1 -1'echo "$temp" | grep -oE '(^|[^-0-9])1\b' | wc -l
Standard input is empty
5
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!