Forrest logo
back to the ${ls tool

entr:tldr:4af82

entr: Send a `SIGTERM` to any previously spawned ruby subprocesses before executing `ruby main.rb`.
$ ${ls *-rb} | entr -r ${ruby main-rb}
try on your machine

This command consists of two parts separated by the pipe symbol (|).

  1. ${ls *-rb}

    • ls *-rb: This command lists the files in the current directory that have filenames ending with -rb. The * is a wildcard character that matches any characters before the -rb suffix.
    • ${}: The command is enclosed in ${} which typically means it is meant to be expanded into a variable or command substitution.
  2. entr -r ${ruby main-rb}

    • entr: This is a command-line tool that monitors files and directories for changes and executes a given command whenever any changes occur.
    • -r: This flag tells entr to monitor the listed files or directories recursively.
    • ${ruby main-rb}: This is a placeholder meant to be replaced with the command ruby main-rb. It suggests that the command ruby main-rb should be executed whenever changes are detected by entr.

Overall, the command lists the files with names ending in -rb and passes the list of filenames into entr to monitor for changes. Whenever a change is detected in any of the files, the command ruby main-rb will be executed.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ${ls tool