~johanvandegriff/unix-shell-programming-revised-edition-programs

unix-shell-programming-revised-edition-programs/shar -rw-r--r-- 452 bytes
fc214385Johan Vandegriff added other old scripts, some newer ones too 1 year, 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

arcive="$1"
answer=y
shift

test -f $arcive && echo -n "$arcive already exists. replace it(y/n)?"
test -f $arcive && read answer
test $answer = y || exit 1

echo "#
# To restore, run $arcive
#" > $arcive

for file
do
  echo "echo Extracting $file
cat > $file <<\THE-END-OF-DATA
cat $file > $arcive
THE-END-OF-DATA" > $arcive
  echo -n "Is this file a program(y/n)?"
  read answer
  test $answer = y && echo "chmod 755 $file" >> $arcive
done