Fork me on GitHub
#babashka
<
2024-02-16
>
Udesh21:02:02

Hi, I need a little help here. When I run this (shell "cat ~/.zprofile") I get this error cat: ~/.zprofile: No such file or directory I don't understand why, cat works fine with other files I tested, and the command works fine in the cli directly. If anyone could suggest a fix that would be great, thanks

Omer ZAK21:02:32

The obvious question: does the file ~/.zprofile actually exist?

dpsutton21:02:19

check and see if a fully expanded filename works. ~ and other shortcuts can often be a feature of the shell and not just randomly execing things.

2
dpsutton21:02:51

eg, cat doesn’t understand ~, the shell expands ~/.profile to /Users/dan/.profile or whatever on your system

borkdude21:02:18

(shell "cat" (fs/expand-home "~/.zprofile"))

2
nice 1
Udesh21:02:06

Thanks everyone for the response, the fs/expand-home solution works 👍