Don't hard code paths in 1990/jaw/shark.sh

It is not actually necessary to mess with the path and in fact the $PATH
variable is no longer modified or even referred to. The purpose of the
program was that even without btoa and uncompress the script should be
able to extract the tarball.

Now only the tarball path is hard coded as reading a tarball from stdin
is problematic though I'm pretty sure it used to work.
This commit is contained in:
Cody Boone Ferguson committed 2023-11-04 04:55:14 -07:00
1 parent b52c1fde23
commit d8ce37e361
3 files changed
+7 -8

No files matched your search

+1 -1
View File
@@ -142,7 +142,7 @@ atob: zcat
${PROG}:
${RM} -f $@
echo 'PATH=;export PATH;./atob|./zcat' > $@
${CHMOD} 0555 $@
${CHMOD} 0755 $@
# alternative executable
#
+2 -2
View File
@@ -9,11 +9,11 @@ for i in "${@?${usage?$0 file...}}";do<"$i"||exit;done
#
# "Cleverly he dialed from within." -- D. Van Vliet, "Trout Mask Replica"
#
PATH=$PATH:.:.. a=atob m=unshark z=zcat
a=atob m=unshark z=zcat
r="rm -f $a $m* ../$m.tar $z" v="cc -Wno-implicit-function-declaration -Wno-implicit-int -o $z $m.c"
trap '$r;exit 1' 1 2 13 15
echo decoding...
(:|compress|btoa|./$a|./$z)2>$m>&2||(sed '1,9s/./#define & /
(:|compress|btoa|$a|$z)2>$m>&2||(sed '1,9s/./#define & /
s/@/[w]/g
s/C/char /g
s/I/;if(/g
+4 -5
View File
@@ -948,10 +948,9 @@ with if the C preprocessor botches single quotes in cpp expansion.
## [1990/jaw](1990/jaw/jaw.c) ([README.md](1990/jaw/README.md]))
Cody fixed the script to work properly in modern environments including paths,
writing to and extracting from stdout, (to do with `$PATH`
not having `.` in it) and relying on the exit code in the commands to allow for
`&& ...`.
Cody fixed the script to work properly in modern environments including writing
to and extracting from `stdout` and relying on the exit code in the commands to
allow for `&& ...`.
He also changed the `perror(3)` call to `fprintf(3)` because in macOS when errno
is 0 it shows what looks like an error.
@@ -961,7 +960,7 @@ the time.
NOTE: as `btoa` is not common we used a ruby script from Yusuke but with a minor
fix applied by Cody that made the program just show `oops` twice from invalid
input.
input but which now works.
## [1990/pjr](1990/pjr/pjr.c) ([README.md](1990/pjr/README.md]))