I/m just playing around trying to hone my grep and pipe with other functions/commands. when I run grep to find a hash tag pipe it to get a count on it. The whole thing gets stuck in term like it is still looking for input when their are no more files in the directoy. how do I get it to exit 0 giving me back my prompt?
test file reads
# hello # what is your name
userx@voided & shit >> $ grep "#" | ls -l total 4 -rw-r--r-- 1 userx userx 29 Sep 26 08:26 testfile ^C userx@voided & shit >> $ grep "#" | ls -l | wc -l > /dev/null ^C userx@voided & shit >> $ grep "#" | ls -l | wc -l 2 ^C userx@voided & shit >> $ grep "#" | ls testfile ^C
it is only one file that I have added the hash tag twice within that file put it into a directory then use this to get a count . after it returns it does not exit.
So now I'm wondering why, what am I doing wrong?