79274796

Date: 2024-12-12 10:53:13
Score: 0.5
Natty:
Report link

You have several issues:

  1. the command failed because / is too close to -name
  2. your regex is not really accurate the risk is that you open too much file
  3. the / dir is your root dir you will open too much file again

To help you :

Are you using bash ? or shell ?

Bash

In Bash, $() -> is to transform a command output as a variable cat $( find . -maxdepth 1 -name "*.txt" -type f)

Shell

In sell, `` -> is to transform a command output as a variable cat find . -maxdepth 1 -name "*.txt" -type f

Then maybe use '.' instead '/' to read only from your current path.

I recommand you to always use Bash. The doc is great and it has a lot of features and it is installed in quite every system. Even if shell for really old machine.

Some links: https://github.com/dylanaraps/pure-bash-bible https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Julien