# (System "command") problem

**URL:** <https://racket.discourse.group/t/system-command-problem/2540>\
**Category:** Questions & Answers\
**Created:** [November 26, 2023, 5:37pm UTC](https://racket.discourse.group/t/system-command-problem/2540 "2023-11-26T17:37:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![matteo-daddio](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/matteo-daddio/32/1245_2.png) [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Post date:** [November 26, 2023, 5:37pm UTC](https://racket.discourse.group/t/system-command-problem/2540/1 "2023-11-26T17:37:18Z")

</div>

Hello,

I'm working on Kubuntu and i'm trying to use _rclone_ for backups.  
I wrote a simple script with _racket/system_:

```scheme
#!/snap/bin/racket

#lang racket/base

(require racket/system)

(newline)
(displayln " The command \"rclone --help\" will be executed")
(display " Do you want to continue?: ")

(if (equal? (read-line) "yes")
    (system "rclone --help")
    (displayln " execution aborted"))

(newline)

```

This gives me an error: _/bin/sh: 1: rclone: not found_

I tryed `(find-executable-path "rclone")` but it gives me `#false`  
If I use `rclone` from the command line it works.

Where's the mistake?

Matteo

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [November 26, 2023, 10:41pm UTC](https://racket.discourse.group/t/system-command-problem/2540/2 "2023-11-26T22:41:12Z")

</div>

It looks like the shell that racket is opening does not have "rclone" in its path. The environment variables for this shell are probably inherited from those shared with racket.

I can see two paths for solving this. One is to work to make sure that the path used in the shell creation are the same as those in your cli shell.

The other way (what I would suggest), is just to use the full path to rclone in your use of system.

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [November 26, 2023, 11:14pm UTC](https://racket.discourse.group/t/system-command-problem/2540/3 "2023-11-26T23:14:04Z")

</div>

It might complicate matters that you are using a Flatpak, but see:

> <https://unix.stackexchange.com/questions/559129/how-do-i-permanently-set-an-environment-variable-for-a-specific-flatpak-applicat>

---

<div class="post-metadata">

**Author:** ![matteo-daddio](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/matteo-daddio/32/1245_2.png) [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Post date:** [December 3, 2023, 11:33am UTC](https://racket.discourse.group/t/system-command-problem/2540/4 "2023-12-03T11:33:38Z")

</div>

> [@jbclements](#):
>
> The other way (what I would suggest), is just to use the full path to rclone in your use of system.

I tryed:

```scheme
which rclone
=> /usr/bin/rclone

```

but if I run:

```scheme
(system "/usr/bin/rclone --help")
=> /bin/sh: 1: /usr/bin/rclone: not found

```

and if I run:

```scheme
(system* "/usr/bin/rclone" "--help")
=> exec failed (No such file or directory; errno=2)

```

If I look in `/usr/bin/` I can find `rclone` and if I run it, it works.

Matteo

---

<div class="post-metadata">

**Author:** ![LiberalArtist](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/liberalartist/32/151_2.png) [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)\
**Post date:** [December 3, 2023, 7:01pm UTC](https://racket.discourse.group/t/system-command-problem/2540/5 "2023-12-03T19:01:24Z")

</div>

> [@soegaard](#):
>
> It might complicate matters that you are using a Flatpak

If you installed Racket as a Flatpak, Snap, or similar, it will likely be running in a mount namespace (in the Linux kernel sense) where `/usr/bin` is different than `/usr/bin` on your real filesystem. You might try:

```scheme
(directory-list "/usr/bin")

```

I expect you will find very few things there.

---

<div class="post-metadata">

**Author:** ![matteo-daddio](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/matteo-daddio/32/1245_2.png) [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Post date:** [December 16, 2023, 2:58pm UTC](https://racket.discourse.group/t/system-command-problem/2540/6 "2023-12-16T14:58:17Z")

</div>

This is not the only problem I encountered so far. I installed  
the Emacs racket-mode but the REPL didn't work.

I tried to install Racket with PPA but It didn't work.  
I installed it through the script and now everything works.

Merry Christmas and Happy New Year  
Matteo
