Project

General

Profile

« Previous | Next » 

Revision 1449

with_cat: Added support for custom cat command in env var

View differences:

bin/with_cat
1 1
#!/bin/bash
2 2
# Runs a command, taking input from the concatenation of the given files
3
# Usage: self file... -- command args...
3
# Usage: env [cat=...] self file... -- command args...
4 4

  
5
test -n "$cat" || cat=cat
6

  
5 7
files=()
6 8
while test "$#" -ge 0; do
7 9
    if test "$1" = --; then
......
12 14
    shift
13 15
done
14 16

  
15
cat "${files[@]}"|"$@"
17
"$cat" "${files[@]}"|"$@"

Also available in: Unified diff