projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
BSD 4_3_Net_2 development
[unix-history]
/
usr
/
src
/
lib
/
libg++
/
grot
/
proto-kit
/
prepend-header
#!/bin/csh -f
# usage: prepend file string1 ... stringn
#
if
(
$#argv
<
2
)
then
echo
incorrect usage
;
exit
1
;
endif
set
FILE
=
$1
;
shift
;
set
TMP
= /
tmp
/
prepend.$$
if
(!(
-r
$FILE
))
then
echo
file
$FILE
not found
;
exit
1
;
endif
set
DUMMY
=
0
while
(
$DUMMY
<
$#argv
)
@ DUMMY
++
echo
"
$argv
[
$DUMMY
]"
>>&
$TMP
end
cat
$FILE
>>
$TMP
cp
$TMP $FILE
rm
-f
$TMP