# “Bad substitution” error while trimming adapters [closed]

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

## closed as unclear what you're asking by Daniel Standage, Kamil S Jaron, llrs, Bioathlete, Kohl KinningApr 8 at 22:10

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• 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 Mar 22 at 3:25
• 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 Mar 25 at 15:18