APPLY(1)
π NAME π
bestie, meet apply β that's APPLY(1), straight out of the User Contributed Perl Documentation section. Its whole thing: run a command many times with different arguments. Iconic behavior, honestly. π«Ά
β¨ SYNOPSIS β¨
apply [-a c] [-d] [-#] command argument [argument ...]
π DESCRIPTION π
apply runs the given command multiple times, with different arguments. Without arguments, command is run once for each argument. If the command contains strings of the form %d+, the d'th next unused argument will be substituted. No cap, that's the whole vibe. β¨
π¦ OPTIONS π¦
apply accepts the following options:
-a cβ use the charactercinstead of%for interpolation of arguments.-dβ print each constructed command but do not execute it. Very "look but don't touch" π-#β if an option of the form-#is given, with#a number,applyuses that many arguments for each call ofcommand. If-0is given as an option,commandis called without arguments, and it is called as many times as there are arguments followingcommandon the command line. This option is ignored ifcommandhas magic%d+sequences.
π ENVIRONMENT π
The working of apply is not influenced by any environment variables. Zero environment drama, periodt. π§
π CAVEATS π
When command has magic %d+ sequences, the string after interpolation of the arguments is handed to a shell for interpretation of meta characters. This shell is determined by Perl, during its building phase, and is typically "/bin/sh -c" on Unix platforms. So yeah, shell stuff is in the mix β noted. π
π BUGS π
apply does not honor the user's $SHELL environment variable. It's giving "I don't take requests," honestly. π
β REVISION HISTORY β
Here's the log, bestie β all the receipts:
$Log: apply,v $
Revision 1.2 2004/08/05 14:17:43 cwest
cleanup, new version number on website
Revision 1.1 2004/07/23 20:09:59 cwest
initial import
Revision 1.1 1999/02/27 03:36:18 abigail
Initial revision
π AUTHOR π
The Perl implementation of apply was written by Abigail, perlpowertools@abigail.be. Legend behavior. π«Ά
π COPYRIGHT and LICENSE π
This program is copyright by Abigail 1999.
This program is free and open software. You may use, copy, modify, distribute and sell this program (and any modified variants) in any way you wish, provided you do not restrict others to do the same.
okay that's the whole page, bestie β this one is perl v5.42.2, dated 2026-02-15. go run your commands many times, slay π
β¨
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms