dnanexus / dx-toolkit

DNAnexus platform client libraries
http://autodoc.dnanexus.com/
Apache License 2.0
90 stars 86 forks source link

How to properly write paths with the CLI #1305

Closed jaumereig closed 1 month ago

jaumereig commented 10 months ago

I am using the command line interface with the objective of running the swiss army knife app and a samtools command to all the WGS CRAM files in this folder: /Bulk/GATK and GraphTyper WGS/Whole genome GATK CRAM files and indices [500k release]/

however, I am having trouble with the path structure in the terminal. I can't find a way to change directory when I use dx cd probably due to the spaces in the folder names and me not finding a way to get around it. I have tried using single or double quotes and using '\' after each space but these don't work so far.

tf2 commented 6 months ago

any answer here? i'm facing similar issue...

jethror1 commented 5 months ago

if you need to cd into directory with spaces in the name, you just need to escape them like you would in a regular unix shell:

Jethros-MBP:~ jethro$ dx mkdir test\ 1
Jethros-MBP:~ jethro$ dx cd test\ 1
Jethros-MBP:~ jethro$ dx pwd
example_project:/test 1
sclan commented 5 months ago

Another example:

% dx mkdir "folder with spaces" % dx cd "folder with spaces"/ % dx pwd foobar:/folder with spaces