Project

General

Profile

« Previous | Next » 

Revision 1551

import_all: Print Usage message if was run without initial "."

View differences:

import_all
1
#!/bin/sh
1
#!/bin/bash
2 2
# Imports all inputs at once
3
# Usage: . self (note initial ".")
4 3

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

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

  
8 12
for input in inputs/*/; do
9 13
    eval "make ${input}import &"
10 14
    disown -h "$(jobs|tail -1|"$selfDir/jobspecs")" # ignore SIGHUP

Also available in: Unified diff