Any more tech savy folk out there know how to create a saf file on a mac? I'm struggling here.
Thanks!
Trying to put name on gear on a mac
-
- Posts: 5
- Joined: Wed Feb 15, 2017 2:43 am
- Team: Privateer
- Contact:
Re: Trying to put name on gear on a mac
Code: Select all
#!/bin/bash
#
# Simple Archive Format
#
#set -C
if test "_$1_" = _c_
then
shift
(for f in "$@"; do wc -c "$f"; done) | awk '{ print $1, $2; }'
echo -
cat "$@"
elif test "_$1_" = _x_
then
shift
count=0
while read size name && test "_${size##[^0-9]}_" = "_${size}_"
do
sizes[count]=$((size))
names[count]=${name}
count=$((count+1))
done
if test "_${size}_" != "_-_"
then
echo "Bad dir"
exit
fi
i=0
while let 'i<count'
do
echo ${names[i]} ${sizes[i]}
if test "_${names[i]##*/}_" != "_${names[i]}_"
then
install -d "${names[i]%/*}"
fi
dd bs=${sizes[i]} count=1 >"${names[i]}" 2>/dev/null
i=$((i+1))
done
else
echo "To create an archive use: saf.sf c files..."
echo "To extract an archive use: saf.sf x"
fi
saf.sf c file1 file2 file3 > file.saf
Discord: StorkeN#6883 - StorkenMXS Youtube - StorkenMXS Instagram - StorkenMXS Facebook - TMFR on Faceboook

