Question: I have very simple bash script:

```
#!/bin/bash
echo -n "A: ";
grep -v ">" | grep -o "A" $1 | wc -l;

```

I type

```
./script.sh 1.fasta

```

I got

```
A: 131

```

But the curcor is still blicking and my script is not finishing. What's wrong here? 

Thank you.

Answer: 
Your first `grep` does not have a file argument so it will read from standard input:

```
grep -v ">"  | grep -o "A" $1 | wc -l;
(read stdin)     (read $1)

```

The reason why you get the `131` is because your second `grep` *does* have a file argument so it's getting all lines in `$1` that have an `A`. However it's *still* waiting around for the end of the first `grep` to finish (which you can do with CTRL-D).

What you *probably* wanted to do is this:

```
grep -v ">" "$1" | grep -o "A" | wc -l

```

This will find all lines in `$1` without a `>`, then all occurrences of `A` in *that,* counting them.
This is the problem command:

```
grep -v ">" | grep -o "A" $1 | wc -l;

```

Since first command `grep -v ">"` is waiting for the input from STDIN as you haven't supplied any file to be searched by `grep`. 

**PS:** Even `grep -o "A" $1` is also problem since piped command will take input from output of the previous command in chain.

Probably you meant:

```
grep -v ">" "$1" | grep -o "A" | wc -l

```