Here is my repo
As you can see in the screenshot below, my tests are failing when running the cat
command… but from what I can tell in the logs, my program is running the command as I would expect it to:
$ cat '/tmp/bar/f 91' '/tmp/bar/f 45' '/tmp/bar/f 34'
What am I missing? I may just need to step away and look at this again with a fresh set of eyes… but I’d appreciate someone else’s eyes taking a look as well ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12)
Thanks!
I figured it out! In case someone else runs into a similar issue…
First a PSA: don’t forget… commit often! Especially before you’re about to refactor, so that you can roll back ALL your changes and not leave artifacts to mess up your logic
![:man_facepalming: :man_facepalming:](https://emoji.discourse-cdn.com/twitter/man_facepalming.png?v=12)
Initially I was returning a string from TokenizeInput()
but I ended up needing to wrap the individual args in single quotes (after concatenating any adjacent quoted strings).
The problem with this approach is that in the function I’m using to execute external commands, I need to pass in the args as a slice. When I tried passing them in as a built out string, cat
wasn’t able to properly parse the string to find the files.
In the end I went back to returning a slice from TokenizeInput()
and then adding a helper function to convert the slice into a string as needed.
1 Like