APPLY(1)

πŸ“¦ version 1.053, in alpine 3.24

πŸŽ€ 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 character c instead 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, apply uses that many arguments for each call of command. If -0 is given as an option, command is called without arguments, and it is called as many times as there are arguments following command on the command line. This option is ignored if command has 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. 🫢

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