0

I've tried several things below, but when there is a - in the path it seems to screw with the environment variable that I'm setting:

leeand00@somehost MINGW64 ~/OneDrive - Some Company Somewhere/mycsvdb (develop)
$ export CSVFILE="/c/Users/leeand00/OneDrive\ -\ Some\ Company\ Somewhere/mycsvdb/.mycsv.sys.csv"

leeand00@somehost MINGW64 ~/OneDrive - Some Company Somewhere/mycsvdb (develop)
$ cat $CSVFILE
cat: unknown option -- \
Try 'cat --help' for more information.

leeand00@somehost MINGW64 ~/OneDrive - Some Company Somewhere/mycsvdb (develop)
$ export CSVFILE="/c/Users/leeand00/OneDrive\ \-\ Some\ Company\ Somewhere/mycsvdb/.mycsv.sys.csv"

leeand00@somehost MINGW64 ~/OneDrive - Some Company Somewhere/mycsvdb (develop)
$ cat $CSVFILE
cat: '/c/Users/leeand00/OneDrive\': Is a directory
cat: '\-\': No such file or directory
cat: 'Some\': No such file or directory
cat: 'Company\': No such file or directory
cat: Somewhere/mycsvdb/.mycsv.sys.csv: No such file or directory

leeand00@somehost MINGW64 ~/OneDrive - Some Company Somewhere/mycsvdb (develop)
$ export -- CSVFILE="/c/Users/leeand00/OneDrive\ -\ Some\ Company\ Somewhere/mycsvdb/.mycsv.sys.csv"

leeand00@somehost MINGW64 ~/OneDrive - Some Company Somewhere/mycsvdb (develop)
$ cat $CSVFILE
cat: unknown option -- \
Try 'cat --help' for more information.

leeand00@somehost MINGW64 ~/OneDrive - Some Company Somewhere/mycsvdb (develop)
$ export CSVFILE="/c/Users/leeand00/OneDrive\ -\ Some\ Company\ Somewhere/mycsvdb/\.mycsv\.sys\.csv"

leeand00@somehost MINGW64 ~/OneDrive - Some Company Somewhere/mycsvdb (develop)
$ cat $CSVFILE
cat: unknown option -- \
Try 'cat --help' for more information.

Is there a way around this?

muru
  • 72,889
leeand00
  • 4,615
  • 1
    export CSVFILE="/c/Users/leeand00/OneDrive - Some Company Somewhere/mycsvdb/.mycsv.sys.csv"; cat "$CSVFILE" – muru Aug 05 '19 at 15:12
  • @muru I'm aware that it works if you do that and put quotes around it, but the script I'm using doesn't do that. – leeand00 Aug 05 '19 at 15:14
  • 4
    Then the script is broken. See dupe. – muru Aug 05 '19 at 15:15
  • Maybe it isn't...I grepped it for the CSVFILE variable name and all I got back was "${CSVFILE}". So why would that cause a problem if it's already in quotes? Is it the curly brackets? – leeand00 Aug 06 '19 at 13:56
  • 2
    Without seeing the script, no saying for sure. Maybe that variable was assigned to something else, which was used unquoted. – muru Aug 06 '19 at 13:59
  • @muru okay so you got me, the name isn't CSVFILE it's KANBANFILE, but it still doesn't allow me to use that...anyway here's the script: https://github.com/leeand00/kanban.bash/tree/feature/mingw64 I modified it from another repo so I could use it in git bash / mingw64. the kanban script is the only file in the repo that I've modified. – leeand00 Aug 06 '19 at 20:01

0 Answers0