Files
mercury/library/print_extra_inits
Fergus Henderson da21c470f9 Fix a shell portability problem: use
Estimated hours taken: 0.25
Branches: main

library/print_extra_inits:
	Fix a shell portability problem: use
		for file in "$@"; do ...
	rather than
		for file; do ...

	(Note that it is safe to use "$@" rather than "${1+$@}" here,
	since we are guaranteed that there will be at least one argument.)
2003-08-08 09:11:29 +00:00

25 lines
797 B
Bash
Executable File

#!/bin/sh
#-----------------------------------------------------------------------------#
# Copyright (C) 2003 The University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
# library/print_extra_inits - print extra .init file lines to stdout.
#
# Invocation:
# print_extra_inits <mer_std.ms>
# where <mer_std.ms> is the names of all of the source files
# for the modules in libmer_std.
#
#-----------------------------------------------------------------------------#
for file in "$@"; do
if [ -f $file ]; then
grep '^INIT ' $file
else
echo "$0: source file $file not found" 1>&2
exit 1
fi
done
exit 0