Linux command
bun-c 命令
文本
Copy it and replace filenames, paths, or keywords as needed.
命令示例
Run a shell command
bun -c "[shell command]"
Run a pipeline
bun -c "cat [file.txt] | grep [pattern]"
Run with environment from .env file
bun -c "[command]" --env-file [.env]
说明
bun -c runs a shell command string, similar to sh -c but using Bun's built-in cross-platform shell implementation. It supports common shell features like pipes, redirects, and environment variable expansion. It can load environment variables from .env files before executing the command, making it useful for running scripts that depend on environment configuration without additional tooling.
参数
- -c _command_
- Execute the given command string using Bun's built-in shell.
- --env-file _file_
- Load environment variables from the specified file before executing.
FAQ
What is the bun-c command used for?
bun -c runs a shell command string, similar to sh -c but using Bun's built-in cross-platform shell implementation. It supports common shell features like pipes, redirects, and environment variable expansion. It can load environment variables from .env files before executing the command, making it useful for running scripts that depend on environment configuration without additional tooling.
How do I run a basic bun-c example?
Run `bun -c "[shell command]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c _command_ do in bun-c?
Execute the given command string using Bun's built-in shell.