Project

General

Profile

« Previous | Next » 

Revision 1948

import_all: Use new with_all. Use ${BASH_SOURCE0} for $self and $self for $0.

View differences:

import_all
1 1
#!/bin/bash
2 2
# Imports all inputs at once
3 3

  
4
self="${BASH_ARGV[0]}"
4
self="${BASH_SOURCE[0]}"
5 5
selfDir="$(dirname -- "$self")"
6 6

  
7 7
if test "${BASH_LINENO[0]}" = 0; then # was run without initial "."
8
    echo "Usage: . $0 (note initial \".\")"|fold -s >&2
9
    exit 2
8
    echo "Usage: . $self (note initial \".\")"|fold -s >&2
9
    return 2
10 10
fi
11 11

  
12
for input in inputs/*/; do
13
    eval "make ${input}import &"
14
    disown -h "$(jobs|tail -1|"$selfDir/jobspecs")" # ignore SIGHUP
15
    sleep 2 # wait for initial output so that outputs don't become jumbled
16
done
12
. "$selfDir/with_all" import

Also available in: Unified diff