PHPackages                             bag2php/p-command - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. bag2php/p-command

ActiveLibrary[CLI &amp; Console](/categories/cli)

bag2php/p-command
=================

AWK like PHP wrapper for command line

04PHP

Since Sep 2Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bag2php/p-command)[ Packagist](https://packagist.org/packages/bag2php/p-command)[ RSS](/packages/bag2php-p-command/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

p - AWK like PHP wrapper for command line
=========================================

[](#p---awk-like-php-wrapper-for-command-line)

`p` command is inspired by [AWK](http://www.awklang.org/), [rb](https://github.com/thisredone/rb) and [opy](https://github.com/ryuichiueda/opy).

Special variable
----------------

[](#special-variable)

- User-modified variables:
    - **`string $OFS`** - Output Field Separator *(default: ` `)* \[AWK compatible\]
    - **`string $ORS`** - Output Record Separator *(default: `PHP_EOL`)* \[AWK compatible\]
- Auto-set variables:
    - **`int $NR`** - The number of input records \[AWK compatible\]
    - **`int $FNR`** - The current record number in the current file \[AWK compatible\]
    - **`string $F0`** - Contains current line
    - **`string[] $F`** - Contains fields separated by `$OFS` \[AWK compatible\]
    - **`int $NF`** - The number of fields in `$F` \[AWK compatible\]
    - **`int $argi`** - Same as `$NR` \[PHP compatible\]
    - **`string $argn`** - Same as `$F0` \[PHP compatible\]

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1cc4bc1729b858086681a12494fda6cced8f26db3d0928ae4d81c68ddf8dc06?d=identicon)[zonuexe](/maintainers/zonuexe)

---

Top Contributors

[![zonuexe](https://avatars.githubusercontent.com/u/822086?v=4)](https://github.com/zonuexe "zonuexe (8 commits)")

### Embed Badge

![Health badge](/badges/bag2php-p-command/health.svg)

```
[![Health](https://phpackages.com/badges/bag2php-p-command/health.svg)](https://phpackages.com/packages/bag2php-p-command)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.3k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71464.1k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20718.9k21](/packages/winbox-args)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
