Rex::Co...ds::Tail(3)
π¦ Rex::Commands::Tail β bestie, let's tail a file π
okay so this page is from the User Contributed Perl Documentation for Rex::Commands::Tail(3), and honestly? it's short, it's sweet, and it does exactly one thing. let's get into it β¨
πΈ NAME πΈ
Rex::Commands::Tail β literally just tail a file. that's the whole vibe. π
β οΈ heads up, bestie: Version <= 1.0: All these functions will not be reported.
β οΈ and also, no cap: All these functions are not idempotent. so don't go thinking you can run them twice and get the same result β that's not the energy here π
π DESCRIPTION π
With this module you can tail a file. that's it. that's the description. iconic, honestly π
β SYNOPSIS β
tail "/var/log/syslog";
one line. one vibe. slay π
π§ EXPORTED FUNCTIONS π§
π tail($file)
This function will tail the given file. super straightforward, main character energy π«Ά
here's the basic usage inside a task:
task "syslog", "server01", sub {
tail "/var/log/syslog";
};
π controlling the output format
okay so if you want to control the output format, you can define a callback function β this is where it gets cute ππ
task "syslog", "server01", sub {
tail "/var/log/syslog", sub {
my ($data) = @_;
my $server = Rex->get_current_connection()->{'server'};
print "$server>> $data\n";
};
};
the way that you just hand it a sub and it hands you $dataβ¦ obsessed. you grab the server name with Rex->get_current_connection()->{'server'}, and you're printing "$server>> $data\n" like the icon you are π₯
π little recap for the girlies π
tail($file)tails the given file. periodt.- want custom output? pass a callback sub. it receives
($data). π - not idempotent. not reported in
Version <= 1.0. don't forget it. π§ β¨
π and that's the whole page, bestie β go tail some logs and have a gorgeous day π
β with love, from the perl v5.42.3 docs, dated 2023-08-05 π
π¦ where this page comes from
- nixos 26.05: perl5.42.3-Rex 1.14.3
- nixpkgs unstable: perl5.42.3-Rex 1.14.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms