Rex::C...s::Tail(3pm)

πŸ’– NAME πŸ’–

Rex::Commands::Tail β€” okay bestie, this one tails a file for you 🫢

Version <= 1.0: all these functions will not be reported. Noted, periodt. πŸ“

Also super important: all these functions are not idempotent. So like… don't run them twice expecting the same vibe, because that's not what's giving. 😭


🌸 DESCRIPTION 🌸

With this module you can tail a file. That's it. That's the whole serve. πŸ’…


✨ SYNOPSIS ✨

tail "/var/log/syslog";

Iconic. Minimal. Ate. πŸ”₯


πŸ¦‹ EXPORTED FUNCTIONS πŸ¦‹

tail($file) πŸ’«

This function will tail the given file. Lowkey exactly what it says on the tin, no cap.

task "syslog", "server01", sub {
  tail "/var/log/syslog";
};

And if you want to control the output format, bestie, you can define a callback function πŸŽ€:

task "syslog", "server01", sub {
  tail "/var/log/syslog", sub {
   my ($data) = @_;

   my $server = Rex->get_current_connection()->{'server'};

   print "$server>> $data\n";
  };
};

Look at that callback. The way it grabs $server and goes "$server>> $data\n". Main character energy fr fr. πŸ‘‘


Heads up bestie: these functions are not idempotent and version <= 1.0 means they won't be reported. Just so you're not out here surprised. πŸ™ˆ

That's the whole page, gorgeous. It's from the User Contributed Perl Documentation, brought to you by perl v5.40.1, dated 2025-10-03. Slay, bye, love you πŸ’œπŸ’–βœ¨

πŸ“¦ where this page comes from