Using single quotes would fix it. But fundamentally this is a bash question-- this list is for GridEngine questions and more on this topic would bore the subscribers. Best to look for a bash tutorial online and learn more about it that way.
On Mon, Jul 9, 2018 at 1:42 PM, VG <gupta567va...@gmail.com> wrote: > Hi Daniel, > I used a named script and it is working as I expected it to work. I am > just trying to understand what is wrong here on the command line when I > submit it to qsub. I know double quotes can be a real pain. I have one set > of double quotes around the seq I want to grep and the other double quotes > are the submission quotes to the qsub command. > > Regards > Varun > > > On Mon, Jul 9, 2018 at 1:30 PM, Daniel Povey <dpo...@gmail.com> wrote: > >> You should put that in a bash script and invoke it by name. >> >> It's really a miracle that it gave you anything even remotely close to >> what you intended when run like that, because of how bash interprets >> double-quotes and variables. Inside double quotes it will expand variables >> with their values at the time the contents of the double-quotes are >> evaluated. >> >> Best to sidestep all those issues by running it as a named scripts. >> >> >> >> >> >> On Mon, Jul 9, 2018 at 1:23 PM, VG <gupta567va...@gmail.com> wrote: >> >>> Hi, >>> I am trying to run a command on the terminal and also submit it to the >>> cluster but I am getting different results. >>> >>> When I type on the terminal this : >>> >>> for i in *_1.fastq.gz; do echo $i >> t.txt; zcat $i | grep >>> "GCTGGCAAAAAGAAGGTAACATGTTTT" >> t.txt ; echo >> t.txt ; done >>> >>> I get the output like this >>> >>> adrenal_4a_ERR315335_1.fastq.gz >>> GCANAGGCCAATGTTGGTGCTGGCAAAAAGAAGGTAACATGTTTTAAGGAACTATGTAGC >>> ATAGTGTCTTAACACCTCAGTAAAGAGATCGGAAGAGCACA >>> >>> adrenal_4a_ERR315452_1.fastq.gz >>> GCAAAGGCCAATGTTGGTGCTGGCAAAAAGAAGGTAACATGTTTTAAGGAACTATGTAGC >>> ATAGTGTCTTAACACCTCAGTAAAGAGATCGGAAGAGCACA >>> CAAGAACAGAATGAAGAAAGTCAGGGGGACTGCAAAGGCCAATGTTGGTGCTGGCAAAAA >>> GAAGGTAACATGTTTTAAGAAACTATGTAGCATAGTGTCTT >>> >>> adrenal_4c_ERR315392_1.fastq.gz >>> >>> adrenal_4c_ERR315450_1.fastq.gz >>> >>> and so on.. >>> >>> >>> This is what the output is expected. >>> >>> When I submit the same command to the hpc cluster via qsub I am getting >>> a completely different result >>> >>> *qsub -l h_vmem=4G -cwd -j y -b y -N n_tr -R y "for i in *_1.fastq.gz; >>> do echo $i >> t.txt; zcat $i | grep "GCTGGCAAAAAGAAGGTAACATGTTTT" >> t.txt >>> ; echo >> t.txt ; done"* >>> >>> adrenal_4a_ERR315452_1.fastq.gz >>> GCAAAGGCCAATGTTGGTGCTGGCAAAAAGAAGGTAACATGTTTTAAGGAACTATGTAGC >>> ATAGTGTCTTAACACCTCAGTAAAGAGATCGGAAGAGCACA >>> CAAGAACAGAATGAAGAAAGTCAGGGGGACTGCAAAGGCCAATGTTGGTGCTGGCAAAAA >>> GAAGGTAACATGTTTTAAGAAACTATGTAGCATAGTGTCTT >>> >>> adrenal_4a_ERR315452_1.fastq.gz >>> >>> appendix_4a_ERR315437_1.fastq.gz >>> GCAAAGGCCAATGTTGGTGCTGGCAAAAAGAAGGTAACATGTTTTAAGGAACTATGTAGC >>> ATAGTGTCTTAACACCTCAGTAAAGAGATCGGAAGAGCACA >>> CAAGAACAGAATGAAGAAAGTCAGGGGGACTGCAAAGGCCAATGTTGGTGCTGGCAAAAA >>> GAAGGTAACATGTTTTAAGAAACTATGTAGCATAGTGTCTT >>> >>> adrenal_4a_ERR315452_1.fastq.gz >>> GCAAAGGCCAATGTTGGTGCTGGCAAAAAGAAGGTAACATGTTTTAAGGAACTATGTAGC >>> ATAGTGTCTTAACACCTCAGTAAAGAGATCGGAAGAGCACA >>> CAAGAACAGAATGAAGAAAGTCAGGGGGACTGCAAAGGCCAATGTTGGTGCTGGCAAAAA >>> GAAGGTAACATGTTTTAAGAAACTATGTAGCATAGTGTCTT >>> >>> adrenal_4a_ERR315452_1.fastq.gz >>> GGACTGCAAAGGCCAATGTTGGTGCTGGCAAAAAGAAGGTAACATGTTTTAAGAAACTAT >>> GTAGCATAGTGTCTTAACACCTCAGTAAAGAGATCGGAAGA >>> >>> appendix_4a_ERR315465_1.fastq.gz >>> GCAAAGGCCAATGTTGGTGCTGGCAAAAAGAAGGTAACATGTTTTAAGGAACTATGTAGC >>> ATAGTGTCTTAACACCTCAGTAAAGAGATCGGAAGAGCACA >>> CAAGAACAGAATGAAGAAAGTCAGGGGGACTGCAAAGGCCAATGTTGGTGCTGGCAAAAA >>> GAAGGTAACATGTTTTAAGAAACTATGTAGCATAGTGTCTT >>> >>> adrenal_4a_ERR315452_1.fastq.gz >>> >>> appendix_4b_ERR315345_1.fastq.gz >>> GCAAAGGCCAATGTTGGTGCTGGCAAAAAGAAGGTAACATGTTTTAAGGAACTATGTAGC >>> ATAGTGTCTTAACACCTCAGTAAAGAGATCGGAAGAGCACA >>> CAAGAACAGAATGAAGAAAGTCAGGGGGACTGCAAAGGCCAATGTTGGTGCTGGCAAAAA >>> GAAGGTAACATGTTTTAAGAAACTATGTAGCATAGTGTCTT >>> >>> adrenal_4a_ERR315452_1.fastq.gz >>> GCAAAGGCCAATGTTGGTGCTGGCAAAAAGAAGGTAACATGTTTTAAGGAACTATGTAGC >>> ATAGTGTCTTAACACCTCAGTAAAGAGATCGGAAGAGCACA >>> CAAGAACAGAATGAAGAAAGTCAGGGGGACTGCAAAGGCCAATGTTGGTGCTGGCAAAAA >>> GAAGGTAACATGTTTTAAGAAACTATGTAGCATAGTGTCTT >>> >>> What is it that I am doing wrong here. >>> >>> Thanks >>> >>> Regards >>> Varun >>> >>> _______________________________________________ >>> users mailing list >>> users@gridengine.org >>> https://gridengine.org/mailman/listinfo/users >>> >>> >> >
_______________________________________________ users mailing list users@gridengine.org https://gridengine.org/mailman/listinfo/users