H
H
helpmeee2021-05-13 17:43:15
JavaScript
helpmeee, 2021-05-13 17:43:15

How do I write a script that will display the CONTENT of the files in a directory?

It is necessary to write a script, when called, it is necessary to pass an argument - the name of a certain directory, the script must check whether this argument is a directory, then display the CONTENTS of all files that this directory contains

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
Jupiter Max, 2018-11-15
@vardoLP

var $menu = $(".menu");
  
  $(window).scroll(function(){
    if ( $(this).scrollTop() > 30){
      $menu.addClass("fixed");
    } else if($(this).scrollTop() <= 30) {
      $menu.removeClass("fixed");
    }
  });

well, then write in styles what will happen to it when the fixed class is added

V
Vladimir Korotenko, 2021-05-13
@helpmeee

cat /home/name/*.txt

V
Victor Taran, 2021-05-13
@shambler81

find /home/lalala -type f -exec cat {} \;
find- find
/home/lalala - where
-type f- file
-exec execute command (find feature)
cat - print file
{}path to the file that find find
\;closes find escaped
if you need to find something in these files instead of cat put grep with what to look for.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question