0

I have one variable:

>   lo=$(dirname "$(echo $FILES2 | awk 'BEGIN {FS=" "} {print $1}')")
echo $lo  => /home/fil/Desktop/overeni_pipeline
> Rko_lo= $(echo $lo"/bam_files/")

and after that I received message:

zsh: permission denied: /home/fil/Desktop/overeni_pipeline/bam_files/

Could you tell me where is the problem? If I use it like superuser, I received message:

sudo: /home/fil/Desktop/overeni_pipeline/bam_files/: command not found

Thank you.

jofel
  • 3,297
  • 17
  • 31
Vonton
  • 2,872
  • 4
  • 20
  • 27

1 Answers1

3

The problem is an additional space.

You wrote

Rko_lo= $(echo $lo"/bam_files/")

instead of

Rko_lo=$(echo $lo"/bam_files/")

This is the reason why the shell try to execute the result of the $(echo ...) command instead of setting $RKO_lo with it.

jofel
  • 3,297
  • 17
  • 31