mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 19:03:45 +00:00
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.)
25 lines
797 B
Bash
Executable File
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
|