You don’t need to write a new tool to forward stdin
– one has already been written (cat
):
(echo "initial command" && cat) | some_tool
This does have the downside of connecting a pipe to some_tool
, not a terminal.
More Related Contents:
- Is it OK to use the same input file as output of a piped command?
- Why doesn’t “sort file1 > file1” work?
- grep lines that contain 1 character followed by another character
- When should I wrap quotes around a shell variable?
- How to convert DOS/Windows newline (CRLF) to Unix newline (LF) in a Bash script
- How to cat a file containing code?
- What’s the magic of “-” (a dash) in command-line parameters?
- What is double dot(..) and single dot(.) in Linux?
- What does the number in parentheses shown after Unix command names in manpages mean?
- Forcing bash to expand variables in a string loaded from a file
- How to instruct cron to execute a job every second week?
- How do I use the lines of a file as arguments of a command?
- How can I programmatically create a new cron job?
- How to concatenate multiple lines of output to one line?
- How to split CSV files as per number of rows specified?
- Using the passwd command from within a shell script
- Pipe output to bash function
- GROUP BY/SUM from shell
- List files recursively in Linux CLI with path relative to the current directory
- How to sort strings that contain a common prefix and suffix numerically from Bash?
- linux: kill background task
- In Linux, how to tell how much memory processes are using?
- Why can’t I use Unix Nohup with Bash For-loop?
- How does vi restore terminal content after quitting it?
- How to print third column to last column?
- Monitor Directory for Changes
- don’t fail jenkins build if execute shell fails
- How can I use xargs to copy files that have spaces and quotes in their names?
- Piping Text To An External Program Appends A Trailing Newline
- Find all files with name containing string [closed]