{"id":23483485,"url":"https://github.com/khtdr/pageboy","last_synced_at":"2025-04-15T00:09:01.103Z","repository":{"id":66113210,"uuid":"51561814","full_name":"khtdr/pageboy","owner":"khtdr","description":"Write your shell scripts in any combination of scripting languages.","archived":false,"fork":false,"pushed_at":"2021-02-21T01:09:40.000Z","size":52,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T00:08:39.470Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khtdr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-12T02:02:53.000Z","updated_at":"2023-11-29T05:45:28.000Z","dependencies_parsed_at":"2023-03-10T23:37:31.775Z","dependency_job_id":null,"html_url":"https://github.com/khtdr/pageboy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khtdr%2Fpageboy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khtdr%2Fpageboy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khtdr%2Fpageboy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khtdr%2Fpageboy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khtdr","download_url":"https://codeload.github.com/khtdr/pageboy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981267,"owners_count":21193147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-24T21:12:05.288Z","updated_at":"2025-04-15T00:09:01.068Z","avatar_url":"https://github.com/khtdr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cimg align=\"right\" src=\"https://raw.githubusercontent.com/khtdr/pageboy/master/logo.png\" width=\"200\" /\u003e\n\npageboy\n=======\n\nWrite your shell scripts in any combination of scripting languages. \n\n\ninstallation\n------------\n\n1. Current version: 2.1.4\n2. Download the [pageboy bash script](https://raw.githubusercontent.com/khtdr/pageboy/master/pageboy) and put into your `$PATH` (ie. `~/bin/`).\n3. Start using `#!/usr/bin/env pageboy` as your shebang line in your bash scripts.\n4. Call other \"pages\" of your script by using the pre-defined `$PAGE` command in your scripts.\n\n```bash\ncurl -o ~/bin/pageboy https://raw.githubusercontent.com/khtdr/pageboy/master/pageboy; chmod +x ~/bin/pageboy\n```\n\nVerify the install\n```bash\n~/bin/pageboy -h\n```\n\n**Example Script** `example.pb`\n\n```bash\n#!/usr/bin/env pageboy\necho in Bash\n$PAGE php\necho back to Bash\n\n#!/usr/bin/env php\n\u003c?php echo \"in PHP\\n\";\n```\n\n```bash\nchmod +x ./example.pb\n./example.pb\n```\n\n_produces the output:_\n\n    in Bash\n    in PHP\n    back to Bash\n\n#### tests\n[![Build Status](https://travis-ci.org/khtdr/pageboy.svg?branch=master)](https://travis-ci.org/khtdr/pageboy)\n```bash\n./run-tests.sh\n```\n    Running test suite for: pageboy-v2.1.4\n    ./tests/aliased.pb ... passed\n    ./tests/args.pb ... passed\n    ./tests/awk.pb ... passed\n    ./tests/big.pb ... passed\n    ./tests/confusing.pb ... passed\n    ./tests/dump.pb ... passed\n    ./tests/env-export.pb ... passed\n    ./tests/lots.pb ... passed\n    ./tests/named.pb ... passed\n    ./tests/page.pb ... passed\n    ./tests/pageboy.pb ... passed\n    ./tests/paths.pb ... passed\n    ./tests/plain-bash.pb ... passed\n    ./tests/print-php.pb ... passed\n    ./tests/pwd.pb ... passed\n    ./tests/run-php.pb ... passed\n    ./tests/subshell-args.pb ... passed\n    ./tests/version.pb ... passed\n    ./tests/weird \"name$\".pb ... passed\n\nYou can mix and match all you want. If your script uses valid [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix)), it will work. If it doesn't, it's a bug and [please let me know](https://github.com/khtdr/pageboy/issues). It also supports the (not quite right) awk shebang: `#!/usr/bin/env awk`.\n\n\nquickstart examples\n-------------------\n\n```bash\n#!/usr/bin/env pageboy\n$PAGE php | wc\n\n#!/usr/bin/env php\n\u003c?php\nphpinfo();\n```\n\n_produces:_\n\n     934    3524   29671\n\n\n_If you want multiple pages of the same language, append an index, starting at 1, to the pagename._\n\n```bash\n#!/usr/bin/env pageboy\ncat \u003c($PAGE php1) \u003c($PAGE php2)\n\n#!/usr/bin/env php\n\u003c?php echo \"one\";\n\n#!/usr/bin/env php\n\u003c?php echo \"two\";\n```\n\n_produces:_\n\n    onetwo\n\nYou can distribute a version of your script without the dependency on `pageboy` by compiling it:\n\n```bash\n# copy above into `onetwo.pb`\nonetwo.pb -c \u003e onetwo.sh\nchmod +x ./onetwo.sh\n./onetwo.sh\n```\n\n_produces:_\n\n    onetwo\n\n**Big Example**\n\n```bash\n#!/usr/bin/env pageboy\ncat \u003c($PAGE php) \u003c($PAGE ruby) \u003c($PAGE bash1) \u003c($PAGE bash2) \u003c($PAGE php2)\n\n#!/usr/bin/env php\n\u003c?php\nfor ($i=10; $i\u003c=20; $i++) {\n  echo $i . \"\\n\";\n}\n\n#!/usr/bin/env ruby\n5.times do\n  puts \"Hello, World! ~ruby1\"\nend\n\n#!/bin/bash\necho \"Hello, World! ~bash2\"\nwhoami\n\n#!/usr/bin/env bash\nenv | grep TERM\n\n#!/usr/bin/env php\n\u003c?php\necho __DIR__;\n```\n\n_produces:_\n\n    10\n    11\n    12\n    13\n    14\n    15\n    16\n    17\n    18\n    19\n    20\n    Hello, World! ~ruby1\n    Hello, World! ~ruby1\n    Hello, World! ~ruby1\n    Hello, World! ~ruby1\n    Hello, World! ~ruby1\n    Hello, World! ~bash2\n    khtdr\n    TERM_PROGRAM=iTerm.app\n    TERM=xterm-256color\n    ITERM_PROFILE=Default\n    ITERM_SESSION_ID=w0t0p0\n    /home/khtdr/\n\nfeature guide\n-------------\n\n```bash\npageboy -h\n```\n\n    pageboy-v2.1.4\n        pageboy            # runs as pageboy script\n        pageboy -r \u003cpage\u003e  # runs requested page\n        pageboy -p \u003cpage\u003e  # prints requested page\n        pageboy -c         # compiles to bash script\n        pageboy -d         # dumps page table\n        pageboy -h         # shows this message\n    https://github.com/khtdr/pageboy\n\nMore examples can be found in the [tests directory](https://github.com/khtdr/pageboy/blob/master/tests/).\n\n\nadvanced features\n-----------------\n\n  - Pages can be named, see https://github.com/khtdr/pageboy/blob/master/tests/named.pb\n  - Args can be passed in, see https://github.com/khtdr/pageboy/blob/master/tests/args.pb\n\n### \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhtdr%2Fpageboy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhtdr%2Fpageboy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhtdr%2Fpageboy/lists"}