Project

General

Profile

« Previous | Next » 

Revision 1380

Added with_cat to run a command, taking input from the concatenation of files

View differences:

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

  
5
files=()
6
while test "$#" -ge 0; do
7
    if test "$1" = --; then
8
        shift
9
        break
10
    fi
11
    files=("${files[@]}" "$1")
12
    shift
13
done
14

  
15
cat "${files[@]}"|"$@"
0 16

  

Also available in: Unified diff