text: user15239: I am performing a bash loop one liner:.
  for k in */Assembly/*/*.fastq; do minimap2 -ax map-ont assembly.fasta $k > mapping.sam; echo $k; done
  
  The file hierarchy is as follows:
  \Drain_4 
      \Assembly
          \A4_assembly
             assembly.fasta
             A4.fastq
          \D3_assembly
          \I8_assembly
          \U7_assembly
  \Drain_5
  \Drain_7
  
  Where \ denotes a directory. This is the error i am getting:
  [ERROR] failed to open file '.fasta': No such file or directory A4.fastq
  
  Both input files are in the same directory.
  The fastq is my current directory. I'm guessing i will need to provide the complete pathname for both my input files?
  I should mention that in all folders the assembly.fasta file is named the same but the fastq file is different (has a different prefix depending on which folder it is in.
  
  user73: The most likely issue is that the assembly.fasta file is not found in the current directory. Taking @m's comments into consideration, a minimal rewriting of your script to fix this would be as follows:
  for k in */Assembly/*/*.fastq; do minimap2 -ax map-ont $(dirname ${k})/assembly.fasta $k > $(dirname ${k})/mapping.sam; echo $k; done
  
  But I'd recommend at least adding additional quote and brace protection, just in case file names contained spaces:
  for k in */Assembly/*/*.fastq;
    fDir = $(dirname ${k});
    do minimap2 -ax map-ont "${fDir}/assembly.fasta" "${k}" > "${fDir}/mapping.sam";
    echo ${k};
  done
  
  edit: fixed up variable capitalisation
  
original_text: 15239: <p>I am performing a bash loop one liner:.</p>
  <pre><code>for k in */Assembly/*/*.fastq; do minimap2 -ax map-ont assembly.fasta <span class="math-container">$k &gt; mapping.sam; echo $</span>k; done
  </code></pre>
  <p>The file hierarchy is as follows:</p>
  <pre><code>\Drain_4 
      \Assembly
          \A4_assembly
             assembly.fasta
             A4.fastq
          \D3_assembly
          \I8_assembly
          \U7_assembly
  \Drain_5
  \Drain_7
  </code></pre>
  <p>Where <code>\</code> denotes a directory. This is the error i am getting:</p>
  <pre><code>[ERROR] failed to open file '.fasta': No such file or directory A4.fastq
  </code></pre>
  <p>Both input files are in the same directory.</p>
  <p>The fastq is my current directory. I'm guessing i will need to provide the complete pathname for both my input files?</p>
  <p>I should mention that in all folders the assembly.fasta file is named the same but the fastq file is different (has a different prefix depending on which folder it is in.</p>
   73: <p>The most likely issue is that the <code>assembly.fasta</code> file is not found in the current directory. Taking @m's comments into consideration, a minimal rewriting of your script to fix this would be as follows:</p>
  <pre><code>for k in */Assembly/*/*.fastq; do minimap2 -ax map-ont <span class="math-container">$(dirname $</span>{k})/assembly.fasta <span class="math-container">$k &gt; $</span>(dirname <span class="math-container">${k})/mapping.sam; echo $</span>k; done
  </code></pre>
  <p>But I'd recommend at least adding additional quote and brace protection, just in case file names contained spaces:</p>
  <pre><code>for k in */Assembly/*/*.fastq;
    fDir = <span class="math-container">$(dirname $</span>{k});
    do minimap2 -ax map-ont &quot;<span class="math-container">${fDir}/assembly.fasta" "$</span>{k}&quot; &gt; &quot;<span class="math-container">${fDir}/mapping.sam";
    echo $</span>{k};
  done
  </code></pre>
  <p>edit: fixed up variable capitalisation</p>
  