Make 1989/fubar/fubar.sh use bash

Fixed for ShellCheck as well.

The if [ .. ] was changed to if [[ .. ]] and this was done in the C code
as well.
This commit is contained in:
Cody Boone Ferguson committed 2024-01-11 09:10:10 -08:00
1 parent 51790b6a94
commit 92a6682216
3 files changed
+7 -4

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ if(m && q=='T' && o=='T'){m=0;(void)fread(tt,11,1,stdin);(void)printf("T %9d\n",
cc ouroboros.c -o x
#define zxc ;{/*
cat ./ouroboros.c | ./x $1 > x1
if [ $? -ne 0 ]; then
if [[ $? -ne 0 ]]; then
exit
fi
mv x1 ./ouroboros.c
+3 -3
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
# to run fubar in the 'proper' way
# parse args
if [ $# -ne 1 ]; then
if [[ $# -ne 1 ]]; then
echo "usage: $0 number" 1>&2
exit 1
fi
@@ -15,5 +15,5 @@ r fubar.c
w ouroboros.c
EOF
chmod +x ouroboros.c
./ouroboros.c $1
./ouroboros.c "$1"
#rm -f ouroboros.c x1 x
+3
View File
@@ -758,6 +758,9 @@ not strictly necessary but nonetheless more correct, even if not warned against.
`$PATH`) to files referred to in the code. The path problem was also fixed in
[fubar.sh](/1989/fubar/fubar.sh).
Cody also 'modernised' the script to use `bash` and fixed for ShellCheck. The
`if [ .. ]` was changed in the C code as well as the script.
## <a name="1989_jar.1"></a>[1989/jar.1](/1989/jar.1/jar.1.c) ([README.md](/1989/jar.1/README.md]))