<p>I have this script to trim adaptors from my fastq sequencing files</p>

<pre><code>for PAIR in $(fastq | sed 's/_R.//g' | uniq)
</code></pre>

<p>I am gitting this error: bad substitution</p>

<p>Could you help </p>

CC BY-SA 4.0
2019-03-22T03:25:02.410Z
Welcome to Bioinformatics.StackExchange! I'd guess this error message is being generated by the `sed` command. But it looks like there are several potential problems with your shell command, the braces around variable names and the listing of the input files (the `fastq | seq | uniq` sequence) in particular. It doesn't look quite right, but to help you it would be helpful if you could give a bit more details about the names and locations of your input files. If there are many, 1 or 2 examples would suffice.
Daniel Standage
CC BY-SA 4.0
2019-03-25T15:18:41.900Z
Hello again, Momo. Your edits actually made it harder for us to answer the question rather than easier. I've voted to close this question, but I'll revoke that vote if you can provide a bit more detail as discussed in my first comment.
Daniel Standage
<fastq><quality-control><shell>
"Bad substitution" error while trimming adapters
# "Bad substitution" error while trimming adapters

(Asked by: username_0 on 2019-03-22)

I have this script to trim adaptors from my fastq sequencing files
for PAIR in $(fastq | sed 's/_R.//g' | uniq)

I am gitting this error: bad substitution
Could you help

**Tags:** fastq, quality-control, shell
> **Comments:**
> **username_1**: Welcome to Bioinformatics.StackExchange! I'd guess this error message is being generated by the `sed` command. But it looks like there are several potential problems with your shell command, the braces around variable names and the listing of the input files (the `fastq | seq | uniq` sequence) in particular. It doesn't look quite right, but to help you it would be helpful if you could give a bit more details about the names and locations of your input files. If there are many, 1 or 2 examples would suffice.  
> **username_1**: Hello again, Momo. Your edits actually made it harder for us to answer the question rather than easier. I've voted to close this question, but I'll revoke that vote if you can provide a bit more detail as discussed in my first comment.  

---

## 0 answers

