From e7781bf70f656c6b371e12bc7e599cc0e93b922e Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Thu, 4 Jan 2024 23:59:44 -0500 Subject: [PATCH 01/15] added helpers for make --- Dockerfile | 3 +- etc/profile.d/help50.sh | 66 +++++++++++++++++++++++++++++++++++++ opt/cs50/bin/make | 35 +++++++++----------- opt/cs50/lib/help50/cd.sh | 9 +++++ opt/cs50/lib/help50/ls.sh | 6 ++++ opt/cs50/lib/help50/make.sh | 42 +++++++++++++++++++++++ tests/bar.c | 1 + tests/foo/baz.c | 0 8 files changed, 142 insertions(+), 20 deletions(-) create mode 100644 etc/profile.d/help50.sh mode change 100755 => 100644 opt/cs50/bin/make create mode 100644 opt/cs50/lib/help50/cd.sh create mode 100644 opt/cs50/lib/help50/ls.sh create mode 100644 opt/cs50/lib/help50/make.sh create mode 100644 tests/bar.c create mode 100644 tests/foo/baz.c diff --git a/Dockerfile b/Dockerfile index ae2d949..374c0da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -153,10 +153,12 @@ RUN curl https://packagecloud.io/install/repositories/cs50/repo/script.deb.sh | bash-completion \ build-essential `# dpkg-dev, libc, gcc, g++, make, etc.`\ clang \ + colorized-logs `# For help50` \ coreutils `# For fold` \ cowsay \ dos2unix \ dnsutils `# For nslookup` \ + expect `# For help50` \ fonts-noto-color-emoji `# For render50` \ gdb \ git \ @@ -188,7 +190,6 @@ RUN curl https://packagecloud.io/install/repositories/cs50/repo/script.deb.sh | cs50 \ Flask \ Flask-Session \ - help50 \ pytest \ render50 \ setuptools \ diff --git a/etc/profile.d/help50.sh b/etc/profile.d/help50.sh new file mode 100644 index 0000000..836a037 --- /dev/null +++ b/etc/profile.d/help50.sh @@ -0,0 +1,66 @@ +# Directory with helpers +HELPERS="/opt/cs50/lib/help50" + +# TEMP +alias make="help50 make" + +# Formatting +bold=$(tput bold) +normal=$(tput sgr0) + + +help50() { + + # Check for helper + if [[ $# -gt 0 && ! -f "${HELPERS}/${1}.sh" ]]; then + echo "Sorry, ${bold}help50${normal} does not yet know how to help with this!" + return 1 + fi + + # Duplicate file descriptors + exec 3>&1 4>&2 + + # Redirect output to a file too + local file="/tmp/help50.$$" # Use PID to support multiple terminals + exec > >(tee -a "$file") 2>&1 + + # Execute command + if [[ "$(type -P -t "$1")" == "file" ]]; then + unbuffer "$@" # Else, e.g., ls isn't colorized + else + "$@" # Can't unbuffer builtins (e.g., cd) + fi + + # Remember status + local status=$? + + # Remember command + local command="$1" + + # Remove command from $@ + shift + + # Get redirected output + local output=$(cat "$file") + + # Remove any ANSI codes + output=$(echo "$output" | ansi2txt | col -b) + + # Restore file descriptors + exec 1>&3 2>&4 + + # Close file descriptors + exec 3>&- 4>&- + + # Remove file + rm --force "$file" + + # Preserve command's status for helpers + (exit $status) + + # Try to get help + local help=$( . "${HELPERS}/${command}.sh" <<< "$output" ) + if [[ -n "$help" ]]; then + echo "🦆 $help" + fi +} diff --git a/opt/cs50/bin/make b/opt/cs50/bin/make old mode 100755 new mode 100644 index 4658e3e..d4275e8 --- a/opt/cs50/bin/make +++ b/opt/cs50/bin/make @@ -1,23 +1,20 @@ #!/bin/bash -# Ensure no targets end with .c -args="" -invalid_args=0 -for arg; do - case "$arg" in - (*.c) arg=${arg%.c}; invalid_args=1;; - esac - args="$args $arg" -done -if [ $invalid_args -eq 1 ]; then - echo "Did you mean 'make$args'?" - exit 1 -fi +# If a single target and not an option +if [[ $# -eq 1 ]] && [[ "$1" != -* ]]; then + + # If no Makefile + if [[ ! -f Makefile && ! -f makefile ]]; then -# Run make -if [[ -d "$1" ]]; then - echo "$1 is a directory" - exit 1 -else - /usr/bin/make -B -s $* + # If target ends with .c or is a directory + if [[ "$1" == *?.c || -d "$1" ]]; then + + # Don't suppress "Nothing to be done" with --silent + /usr/bin/make "$1" + exit $? + fi + fi fi + +# Don't echo recipes +/usr/bin/make --always-make --silent "$@" diff --git a/opt/cs50/lib/help50/cd.sh b/opt/cs50/lib/help50/cd.sh new file mode 100644 index 0000000..01e9087 --- /dev/null +++ b/opt/cs50/lib/help50/cd.sh @@ -0,0 +1,9 @@ +echo "EXIT: $?" +local stdin=$(cat) +#echo "stdout[$stdout]" +#echo "1[$1]" +#echo "2[$2]" +#echo "pwd[$PWD]" +#echo "STDOUT:$stdout" +echo "STDIN:$stdin" +return 0 diff --git a/opt/cs50/lib/help50/ls.sh b/opt/cs50/lib/help50/ls.sh new file mode 100644 index 0000000..ce456b2 --- /dev/null +++ b/opt/cs50/lib/help50/ls.sh @@ -0,0 +1,6 @@ +echo "argv:[$argv]" +echo "stdout[$stdout]" +echo "1[$1]" +echo "2[$2]" +echo "pwd[$PWD]" +return 0 diff --git a/opt/cs50/lib/help50/make.sh b/opt/cs50/lib/help50/make.sh new file mode 100644 index 0000000..5b64739 --- /dev/null +++ b/opt/cs50/lib/help50/make.sh @@ -0,0 +1,42 @@ +local output=$(cat) + +local regex="make: Nothing to be done for '(.*)'" +if [[ "$output" =~ $regex ]]; then + + # If target is a directory + if [[ -d "$1" ]]; then + echo "Cannot run ${bold}make${normal} on a directory. Did you mean to ${bold}cd ${1}${normal} first?" + return + fi + + # If target ends with .c + if [[ "$1" == *?.c ]]; then + base="${1%.c}" + if [[ -n "$base" && ! -d "$base" ]]; then + echo "Did you mean to ${bold}make ${base}${normal}?" + return + fi + fi + +fi + +local regex="No rule to make target '(.*)'" +if [[ "$output" =~ $regex ]]; then + + # If no .c file for target + local c="$1.c" + if [[ ! -f "$c" ]]; then + + # Search recursively for .c file + paths=$(find * -name "$c" 2> /dev/null) + lines=$(echo "$paths" | grep -c .) + echo -n "There isn't a file called ${bold}${c}${normal} in your current directory." + if [[ "$lines" -eq 1 ]]; then # If unambiguous + d=$(dirname "$paths") + echo " Did you mean to ${bold}cd ${d}${normal} first?" + else + echo + fi + return + fi +fi diff --git a/tests/bar.c b/tests/bar.c new file mode 100644 index 0000000..b552c8e --- /dev/null +++ b/tests/bar.c @@ -0,0 +1 @@ +int main(void) {} diff --git a/tests/foo/baz.c b/tests/foo/baz.c new file mode 100644 index 0000000..e69de29 From 1f25bf5be623035557cb276ec599f8359123f96e Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 18:35:02 -0500 Subject: [PATCH 02/15] tidying helper framework --- etc/profile.d/help50.sh | 52 +++++++++++++++++++++++++++---------- opt/cs50/bin/cp | 3 +++ opt/cs50/bin/curl | 3 +++ opt/cs50/bin/make | 0 opt/cs50/lib/help50/cd.sh | 9 ------- opt/cs50/lib/help50/ls.sh | 6 ----- opt/cs50/lib/help50/make.sh | 6 ++--- 7 files changed, 48 insertions(+), 31 deletions(-) create mode 100755 opt/cs50/bin/cp create mode 100755 opt/cs50/bin/curl mode change 100644 => 100755 opt/cs50/bin/make diff --git a/etc/profile.d/help50.sh b/etc/profile.d/help50.sh index 836a037..e468df7 100644 --- a/etc/profile.d/help50.sh +++ b/etc/profile.d/help50.sh @@ -1,14 +1,21 @@ # Directory with helpers HELPERS="/opt/cs50/lib/help50" -# TEMP -alias make="help50 make" +# Temporary files +FILE="/tmp/help50.$$" # Use PID to support multiple terminals +HELP="${FILE}.help" +OUTPUT="${FILE}.output" + +# Supported helpers +#for helper in "$HELPERS"/*.sh; do +# command=$(basename "$helper" .sh) +# echo "$command"="help50 $command" +#done # Formatting bold=$(tput bold) normal=$(tput sgr0) - help50() { # Check for helper @@ -21,8 +28,7 @@ help50() { exec 3>&1 4>&2 # Redirect output to a file too - local file="/tmp/help50.$$" # Use PID to support multiple terminals - exec > >(tee -a "$file") 2>&1 + exec > >(tee -a "$FILE") 2>&1 # Execute command if [[ "$(type -P -t "$1")" == "file" ]]; then @@ -31,17 +37,15 @@ help50() { "$@" # Can't unbuffer builtins (e.g., cd) fi - # Remember status + # Remember these local status=$? - - # Remember command local command="$1" # Remove command from $@ shift - # Get redirected output - local output=$(cat "$file") + # Get tee'd output + local output=$(cat "$FILE") # Remove any ANSI codes output=$(echo "$output" | ansi2txt | col -b) @@ -52,15 +56,37 @@ help50() { # Close file descriptors exec 3>&- 4>&- - # Remove file + # Remove tee'd output rm --force "$file" - # Preserve command's status for helpers + # Restore $? to that of original command (exit $status) # Try to get help local help=$( . "${HELPERS}/${command}.sh" <<< "$output" ) if [[ -n "$help" ]]; then - echo "🦆 $help" + echo "$help" > "$HELP" + elif [[ $status -ne 0 ]]; then + echo "$output" > "$OUTPUT" + fi +} + +_help50() { + #history -a + if [[ -f "$HELP" ]]; then + echo -n "🦆 " + cat "$HELP" + rm --force "$HELP" + elif [[ -f "$OUTPUT" ]]; then + echo non-zero but no helper + rm --force "$OUTPUT" + else + echo zero fi } + +_help50() { + echo 222 +} + +export PROMPT_COMMAND=_help50 diff --git a/opt/cs50/bin/cp b/opt/cs50/bin/cp new file mode 100755 index 0000000..9a2ab78 --- /dev/null +++ b/opt/cs50/bin/cp @@ -0,0 +1,3 @@ +#!/bin/bash + +cp --interactive "$@" diff --git a/opt/cs50/bin/curl b/opt/cs50/bin/curl new file mode 100755 index 0000000..0f6171c --- /dev/null +++ b/opt/cs50/bin/curl @@ -0,0 +1,3 @@ +#!/bin/bash + +curl --http2 "$@" diff --git a/opt/cs50/bin/make b/opt/cs50/bin/make old mode 100644 new mode 100755 diff --git a/opt/cs50/lib/help50/cd.sh b/opt/cs50/lib/help50/cd.sh index 01e9087..e69de29 100644 --- a/opt/cs50/lib/help50/cd.sh +++ b/opt/cs50/lib/help50/cd.sh @@ -1,9 +0,0 @@ -echo "EXIT: $?" -local stdin=$(cat) -#echo "stdout[$stdout]" -#echo "1[$1]" -#echo "2[$2]" -#echo "pwd[$PWD]" -#echo "STDOUT:$stdout" -echo "STDIN:$stdin" -return 0 diff --git a/opt/cs50/lib/help50/ls.sh b/opt/cs50/lib/help50/ls.sh index ce456b2..e69de29 100644 --- a/opt/cs50/lib/help50/ls.sh +++ b/opt/cs50/lib/help50/ls.sh @@ -1,6 +0,0 @@ -echo "argv:[$argv]" -echo "stdout[$stdout]" -echo "1[$1]" -echo "2[$2]" -echo "pwd[$PWD]" -return 0 diff --git a/opt/cs50/lib/help50/make.sh b/opt/cs50/lib/help50/make.sh index 5b64739..136c8f0 100644 --- a/opt/cs50/lib/help50/make.sh +++ b/opt/cs50/lib/help50/make.sh @@ -1,6 +1,6 @@ -local output=$(cat) +output=$(cat) -local regex="make: Nothing to be done for '(.*)'" +regex="make: Nothing to be done for '(.*)'" if [[ "$output" =~ $regex ]]; then # If target is a directory @@ -20,7 +20,7 @@ if [[ "$output" =~ $regex ]]; then fi -local regex="No rule to make target '(.*)'" +regex="No rule to make target '(.*)'" if [[ "$output" =~ $regex ]]; then # If no .c file for target From f92afe5216d9c2f939102c1e1776e19cdde1e7b3 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 20:05:18 -0500 Subject: [PATCH 03/15] using functions instead of aliases --- etc/profile.d/help50.sh | 20 +++++++++----------- opt/cs50/lib/help50/cd | 1 + opt/cs50/lib/help50/cd.sh | 0 opt/cs50/lib/help50/ls | 1 + opt/cs50/lib/help50/ls.sh | 0 opt/cs50/lib/help50/{make.sh => make} | 2 ++ 6 files changed, 13 insertions(+), 11 deletions(-) create mode 100755 opt/cs50/lib/help50/cd delete mode 100644 opt/cs50/lib/help50/cd.sh create mode 100755 opt/cs50/lib/help50/ls delete mode 100644 opt/cs50/lib/help50/ls.sh rename opt/cs50/lib/help50/{make.sh => make} (98%) mode change 100644 => 100755 diff --git a/etc/profile.d/help50.sh b/etc/profile.d/help50.sh index e468df7..3a023f5 100644 --- a/etc/profile.d/help50.sh +++ b/etc/profile.d/help50.sh @@ -6,11 +6,13 @@ FILE="/tmp/help50.$$" # Use PID to support multiple terminals HELP="${FILE}.help" OUTPUT="${FILE}.output" +alias cd="HOME=/tmp cd" + # Supported helpers -#for helper in "$HELPERS"/*.sh; do -# command=$(basename "$helper" .sh) -# echo "$command"="help50 $command" -#done +for helper in "$HELPERS"/*; do + name=$(basename "$helper") + eval "function ${name}() { help50 "$name" \"\$@\"; }" +done # Formatting bold=$(tput bold) @@ -19,7 +21,7 @@ normal=$(tput sgr0) help50() { # Check for helper - if [[ $# -gt 0 && ! -f "${HELPERS}/${1}.sh" ]]; then + if [[ $# -gt 0 && ! -f "${HELPERS}/${1}" ]]; then echo "Sorry, ${bold}help50${normal} does not yet know how to help with this!" return 1 fi @@ -34,7 +36,7 @@ help50() { if [[ "$(type -P -t "$1")" == "file" ]]; then unbuffer "$@" # Else, e.g., ls isn't colorized else - "$@" # Can't unbuffer builtins (e.g., cd) + command "$@" # Can't unbuffer builtins (e.g., cd) fi # Remember these @@ -63,7 +65,7 @@ help50() { (exit $status) # Try to get help - local help=$( . "${HELPERS}/${command}.sh" <<< "$output" ) + local help=$( . "${HELPERS}/${command}" <<< "$output" ) if [[ -n "$help" ]]; then echo "$help" > "$HELP" elif [[ $status -ne 0 ]]; then @@ -85,8 +87,4 @@ _help50() { fi } -_help50() { - echo 222 -} - export PROMPT_COMMAND=_help50 diff --git a/opt/cs50/lib/help50/cd b/opt/cs50/lib/help50/cd new file mode 100755 index 0000000..a9bf588 --- /dev/null +++ b/opt/cs50/lib/help50/cd @@ -0,0 +1 @@ +#!/bin/bash diff --git a/opt/cs50/lib/help50/cd.sh b/opt/cs50/lib/help50/cd.sh deleted file mode 100644 index e69de29..0000000 diff --git a/opt/cs50/lib/help50/ls b/opt/cs50/lib/help50/ls new file mode 100755 index 0000000..a9bf588 --- /dev/null +++ b/opt/cs50/lib/help50/ls @@ -0,0 +1 @@ +#!/bin/bash diff --git a/opt/cs50/lib/help50/ls.sh b/opt/cs50/lib/help50/ls.sh deleted file mode 100644 index e69de29..0000000 diff --git a/opt/cs50/lib/help50/make.sh b/opt/cs50/lib/help50/make old mode 100644 new mode 100755 similarity index 98% rename from opt/cs50/lib/help50/make.sh rename to opt/cs50/lib/help50/make index 136c8f0..c6464be --- a/opt/cs50/lib/help50/make.sh +++ b/opt/cs50/lib/help50/make @@ -1,3 +1,5 @@ +#!/bin/bash + output=$(cat) regex="make: Nothing to be done for '(.*)'" From 5470fcf80b6c424c2ef6b9fd7dc9a14764a37701 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 20:09:13 -0500 Subject: [PATCH 04/15] removed support for exit statuses, supporting any executable helper --- etc/profile.d/help50.sh | 7 +------ opt/cs50/lib/help50/make | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/etc/profile.d/help50.sh b/etc/profile.d/help50.sh index 3a023f5..7647bd8 100644 --- a/etc/profile.d/help50.sh +++ b/etc/profile.d/help50.sh @@ -6,8 +6,6 @@ FILE="/tmp/help50.$$" # Use PID to support multiple terminals HELP="${FILE}.help" OUTPUT="${FILE}.output" -alias cd="HOME=/tmp cd" - # Supported helpers for helper in "$HELPERS"/*; do name=$(basename "$helper") @@ -61,11 +59,8 @@ help50() { # Remove tee'd output rm --force "$file" - # Restore $? to that of original command - (exit $status) - # Try to get help - local help=$( . "${HELPERS}/${command}" <<< "$output" ) + local help=$("${HELPERS}/${command}" "$@" <<< "$output") if [[ -n "$help" ]]; then echo "$help" > "$HELP" elif [[ $status -ne 0 ]]; then diff --git a/opt/cs50/lib/help50/make b/opt/cs50/lib/help50/make index c6464be..9cbb813 100755 --- a/opt/cs50/lib/help50/make +++ b/opt/cs50/lib/help50/make @@ -8,7 +8,7 @@ if [[ "$output" =~ $regex ]]; then # If target is a directory if [[ -d "$1" ]]; then echo "Cannot run ${bold}make${normal} on a directory. Did you mean to ${bold}cd ${1}${normal} first?" - return + exit fi # If target ends with .c @@ -16,7 +16,7 @@ if [[ "$output" =~ $regex ]]; then base="${1%.c}" if [[ -n "$base" && ! -d "$base" ]]; then echo "Did you mean to ${bold}make ${base}${normal}?" - return + exit fi fi @@ -39,6 +39,6 @@ if [[ "$output" =~ $regex ]]; then else echo fi - return + exit fi fi From c4b6fbefba45daebfaa87e768899c3420ff5dcf5 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 20:43:01 -0500 Subject: [PATCH 05/15] added PIPESTATUS for helpers --- etc/profile.d/help50.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/etc/profile.d/help50.sh b/etc/profile.d/help50.sh index 7647bd8..2d5e8dd 100644 --- a/etc/profile.d/help50.sh +++ b/etc/profile.d/help50.sh @@ -18,12 +18,6 @@ normal=$(tput sgr0) help50() { - # Check for helper - if [[ $# -gt 0 && ! -f "${HELPERS}/${1}" ]]; then - echo "Sorry, ${bold}help50${normal} does not yet know how to help with this!" - return 1 - fi - # Duplicate file descriptors exec 3>&1 4>&2 @@ -60,7 +54,10 @@ help50() { rm --force "$file" # Try to get help - local help=$("${HELPERS}/${command}" "$@" <<< "$output") + local helper="${HELPERS}/${command}" + if [[ -f "$helper" && -x "$helper" ]]; then + local help=$(PIPESTATUS=($status) "$helper" "$@" <<< "$output") + fi if [[ -n "$help" ]]; then echo "$help" > "$HELP" elif [[ $status -ne 0 ]]; then From 8ee1e52500efcf630802e053c8c01cb97e48b123 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 21:05:28 -0500 Subject: [PATCH 06/15] removed PIPESTATUS --- etc/profile.d/help50.sh | 2 +- foo.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 foo.sh diff --git a/etc/profile.d/help50.sh b/etc/profile.d/help50.sh index 2d5e8dd..1ee222d 100644 --- a/etc/profile.d/help50.sh +++ b/etc/profile.d/help50.sh @@ -56,7 +56,7 @@ help50() { # Try to get help local helper="${HELPERS}/${command}" if [[ -f "$helper" && -x "$helper" ]]; then - local help=$(PIPESTATUS=($status) "$helper" "$@" <<< "$output") + local help=$("$helper" "$@" <<< "$output") fi if [[ -n "$help" ]]; then echo "$help" > "$HELP" diff --git a/foo.sh b/foo.sh new file mode 100755 index 0000000..f96cda6 --- /dev/null +++ b/foo.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +x=(a b c) +y=foo +export x +export y +env From b003947a79048988fedfb60c670903ead63ae408 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 21:05:39 -0500 Subject: [PATCH 07/15] removed test file --- foo.sh | 7 ------- 1 file changed, 7 deletions(-) delete mode 100755 foo.sh diff --git a/foo.sh b/foo.sh deleted file mode 100755 index f96cda6..0000000 --- a/foo.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -x=(a b c) -y=foo -export x -export y -env From 9279b1dba4564a8da0c28cd81d600cb2212e7331 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 22:00:55 -0500 Subject: [PATCH 08/15] added _helpful, _helpless --- etc/profile.d/help50.sh | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/etc/profile.d/help50.sh b/etc/profile.d/help50.sh index 1ee222d..88bf7c0 100644 --- a/etc/profile.d/help50.sh +++ b/etc/profile.d/help50.sh @@ -3,8 +3,8 @@ HELPERS="/opt/cs50/lib/help50" # Temporary files FILE="/tmp/help50.$$" # Use PID to support multiple terminals -HELP="${FILE}.help" -OUTPUT="${FILE}.output" +HELPFUL="${FILE}.help" +HELPLESS="${FILE}.output" # Supported helpers for helper in "$HELPERS"/*; do @@ -12,10 +12,6 @@ for helper in "$HELPERS"/*; do eval "function ${name}() { help50 "$name" \"\$@\"; }" done -# Formatting -bold=$(tput bold) -normal=$(tput sgr0) - help50() { # Duplicate file descriptors @@ -58,25 +54,28 @@ help50() { if [[ -f "$helper" && -x "$helper" ]]; then local help=$("$helper" "$@" <<< "$output") fi - if [[ -n "$help" ]]; then - echo "$help" > "$HELP" - elif [[ $status -ne 0 ]]; then - echo "$output" > "$OUTPUT" + if [[ -n "$help" ]]; then # If helpful + echo "$help" > "$HELPFUL" + elif [[ $status -ne 0 ]]; then # If helpless + echo "$output" > "$HELPLESS" fi } _help50() { - #history -a - if [[ -f "$HELP" ]]; then - echo -n "🦆 " - cat "$HELP" - rm --force "$HELP" - elif [[ -f "$OUTPUT" ]]; then - echo non-zero but no helper - rm --force "$OUTPUT" - else - echo zero + if [[ -f "$HELPFUL" ]]; then + _helpful "$HELPFUL" + elif [[ -f "$HELPLESS" ]]; then + _helpless "$HELPLESS" fi + rm --force "$HELPFUL" "$HELPLESS" } -export PROMPT_COMMAND=_help50 +_helpful() { + echo -n "🦆 " + # https://www.gnu.org/software/termutils/manual/termutils-2.0/html_chapter/tput_1.html#SEC8 + cat "$1" | sed "s/\`\([^\`]*\)\`/$(tput smso)\1$(tput rmso)/g" +} + +_helpless() { :; } + +export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }_help50" From 26e431d940bda3dd4098661fbc058392cfee1071 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 22:01:01 -0500 Subject: [PATCH 09/15] removed, updated wrappers --- opt/cs50/bin/cp | 3 --- opt/cs50/bin/curl | 3 --- opt/cs50/lib/help50/make | 8 ++++---- 3 files changed, 4 insertions(+), 10 deletions(-) delete mode 100755 opt/cs50/bin/cp delete mode 100755 opt/cs50/bin/curl diff --git a/opt/cs50/bin/cp b/opt/cs50/bin/cp deleted file mode 100755 index 9a2ab78..0000000 --- a/opt/cs50/bin/cp +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -cp --interactive "$@" diff --git a/opt/cs50/bin/curl b/opt/cs50/bin/curl deleted file mode 100755 index 0f6171c..0000000 --- a/opt/cs50/bin/curl +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -curl --http2 "$@" diff --git a/opt/cs50/lib/help50/make b/opt/cs50/lib/help50/make index 9cbb813..2b89551 100755 --- a/opt/cs50/lib/help50/make +++ b/opt/cs50/lib/help50/make @@ -7,7 +7,7 @@ if [[ "$output" =~ $regex ]]; then # If target is a directory if [[ -d "$1" ]]; then - echo "Cannot run ${bold}make${normal} on a directory. Did you mean to ${bold}cd ${1}${normal} first?" + echo "Cannot run \`make\` on a directory. Did you mean to \`cd ${1}\` first?" exit fi @@ -15,7 +15,7 @@ if [[ "$output" =~ $regex ]]; then if [[ "$1" == *?.c ]]; then base="${1%.c}" if [[ -n "$base" && ! -d "$base" ]]; then - echo "Did you mean to ${bold}make ${base}${normal}?" + echo "Did you mean to \`make ${base}\`?" exit fi fi @@ -32,10 +32,10 @@ if [[ "$output" =~ $regex ]]; then # Search recursively for .c file paths=$(find * -name "$c" 2> /dev/null) lines=$(echo "$paths" | grep -c .) - echo -n "There isn't a file called ${bold}${c}${normal} in your current directory." + echo -n "There isn't a file called \`${c}\` in your current directory." if [[ "$lines" -eq 1 ]]; then # If unambiguous d=$(dirname "$paths") - echo " Did you mean to ${bold}cd ${d}${normal} first?" + echo " Did you mean to \`cd ${d}\` first?" else echo fi From a0783ce10bcd0a8c7e0faf276ce7d7aaebcf9b7b Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 22:15:14 -0500 Subject: [PATCH 10/15] updated formatting --- opt/cs50/bin/http-server | 8 ++++---- opt/cs50/bin/sqlite3 | 10 +++++----- opt/cs50/bin/valgrind | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/opt/cs50/bin/http-server b/opt/cs50/bin/http-server index a0f1c26..120cd75 100755 --- a/opt/cs50/bin/http-server +++ b/opt/cs50/bin/http-server @@ -10,12 +10,12 @@ options="--no-dotfiles" t="-t0" # Formatting -bold=$(tput bold) -normal=$(tput sgr0) +smso=$(tput smso) +rmso=$(tput sgr0) # Check for app.py or wsgi.py if [[ -f app.py ]] || [[ -f wsgi.py ]]; then - read -p "Are you sure you want to run ${bold}http-server${normal} and not ${bold}flask${normal}? [y/N] " -r + read -p "Are you sure you want to run ${smso}http-server${rmso} and not ${smso}flask${rmso}? [y/N] " -r if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then exit 1 fi @@ -23,7 +23,7 @@ fi # Check for path if [[ $# -eq 1 ]] && [[ $1 != -* ]] && [[ ! $1 =~ ^\./?$ ]]; then - read -p "Are you sure you want to serve ${bold}${1}${normal} and not your current directory? [y/N] " -r + read -p "Are you sure you want to serve ${smso}${1}${rmso} and not your current directory? [y/N] " -r if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then exit 1 fi diff --git a/opt/cs50/bin/sqlite3 b/opt/cs50/bin/sqlite3 index 3c1c0e7..1aa8f93 100755 --- a/opt/cs50/bin/sqlite3 +++ b/opt/cs50/bin/sqlite3 @@ -1,8 +1,8 @@ #!/bin/bash # Formatting -bold=$(tput bold) -normal=$(tput sgr0) +smso=$(tput smso) +rmso=$(tput sgr0) # If data is coming from stdin (pipe or redirection) if [[ -p /dev/stdin || ! -t 0 ]]; then @@ -12,7 +12,7 @@ fi # If no command-line argument if [[ $# -eq 0 ]]; then - read -p "Are you sure you want to run ${bold}sqlite3${normal} without a command-line argument (e.g., the filename of a database)? [y/N] " -r + read -p "Are you sure you want to run ${smso}sqlite3${rmso} without a command-line argument (e.g., the filename of a database)? [y/N] " -r if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then exit 1 fi @@ -21,12 +21,12 @@ if [[ $# -eq 0 ]]; then elif [[ $# -eq 1 ]] && [[ ! "$1" =~ ^- ]]; then if [[ ! -f "$1" ]]; then if [[ ! "$1" =~ \.db$ ]]; then - read -p "Are you sure you want to create ${bold}$1${normal}? SQLite filenames usually end in ${bold}.db${normal}. [y/N] " -r + read -p "Are you sure you want to create ${smso}$1${rmso}? SQLite filenames usually end in ${smso}.db${rmso}. [y/N] " -r if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then exit 1 fi else - read -p "Are you sure you want to create ${bold}$1${normal}? [y/N] " -r + read -p "Are you sure you want to create ${smso}$1${rmso}? [y/N] " -r if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then exit 1 fi diff --git a/opt/cs50/bin/valgrind b/opt/cs50/bin/valgrind index 60a6429..2ed1e53 100755 --- a/opt/cs50/bin/valgrind +++ b/opt/cs50/bin/valgrind @@ -1,12 +1,12 @@ #!/bin/bash # Formatting -bold=$(tput bold) -normal=$(tput sgr0) +smso=$(tput smso) +rmso=$(tput sgr0) # If run on Python program if [[ "$1" == "python" || "$1" == *.py ]]; then - echo "Afraid ${bold}valgrind${normal} does not support Python programs!" + echo "Afraid ${smso}valgrind${rmso} does not support Python programs!" exit 1 fi From cadd89002b0b1c659cb2a8d92b91d0af0fd53053 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 22:38:26 -0500 Subject: [PATCH 11/15] added _help function to standardize formatting --- etc/profile.d/help50.sh | 3 +-- opt/cs50/bin/_help | 13 +++++++++++++ opt/cs50/bin/http-server | 8 ++------ opt/cs50/bin/sqlite3 | 10 +++------- opt/cs50/bin/valgrind | 6 +----- 5 files changed, 20 insertions(+), 20 deletions(-) create mode 100755 opt/cs50/bin/_help diff --git a/etc/profile.d/help50.sh b/etc/profile.d/help50.sh index 88bf7c0..7a4b37e 100644 --- a/etc/profile.d/help50.sh +++ b/etc/profile.d/help50.sh @@ -72,8 +72,7 @@ _help50() { _helpful() { echo -n "🦆 " - # https://www.gnu.org/software/termutils/manual/termutils-2.0/html_chapter/tput_1.html#SEC8 - cat "$1" | sed "s/\`\([^\`]*\)\`/$(tput smso)\1$(tput rmso)/g" + cat "$1" | _help } _helpless() { :; } diff --git a/opt/cs50/bin/_help b/opt/cs50/bin/_help new file mode 100755 index 0000000..fc7734b --- /dev/null +++ b/opt/cs50/bin/_help @@ -0,0 +1,13 @@ +#!/bin/bash + +# If command-line arguments +if [[ -t 0 ]]; then + input="$*" + +# If standard input +else + input=$(cat) +fi + +# https://www.gnu.org/software/termutils/manual/termutils-2.0/html_chapter/tput_1.html#SEC8 +echo "$input" | sed "s/\`\([^\`]*\)\`/$(tput smso)\1$(tput rmso)/g" diff --git a/opt/cs50/bin/http-server b/opt/cs50/bin/http-server index 120cd75..dcb9369 100755 --- a/opt/cs50/bin/http-server +++ b/opt/cs50/bin/http-server @@ -9,13 +9,9 @@ port="-p 8080" options="--no-dotfiles" t="-t0" -# Formatting -smso=$(tput smso) -rmso=$(tput sgr0) - # Check for app.py or wsgi.py if [[ -f app.py ]] || [[ -f wsgi.py ]]; then - read -p "Are you sure you want to run ${smso}http-server${rmso} and not ${smso}flask${rmso}? [y/N] " -r + read -p "$(_help "Are you sure you want to run \`http-server\` and not \`flask\`? [y/N] ")" -r if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then exit 1 fi @@ -23,7 +19,7 @@ fi # Check for path if [[ $# -eq 1 ]] && [[ $1 != -* ]] && [[ ! $1 =~ ^\./?$ ]]; then - read -p "Are you sure you want to serve ${smso}${1}${rmso} and not your current directory? [y/N] " -r + read -p "$(_help "Are you sure you want to serve \`${1}\` and not your current directory? [y/N] ")" -r if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then exit 1 fi diff --git a/opt/cs50/bin/sqlite3 b/opt/cs50/bin/sqlite3 index 1aa8f93..d59bcd5 100755 --- a/opt/cs50/bin/sqlite3 +++ b/opt/cs50/bin/sqlite3 @@ -1,9 +1,5 @@ #!/bin/bash -# Formatting -smso=$(tput smso) -rmso=$(tput sgr0) - # If data is coming from stdin (pipe or redirection) if [[ -p /dev/stdin || ! -t 0 ]]; then /usr/local/bin/sqlite3 -nullvalue NULL -table "$@" < /dev/stdin @@ -12,7 +8,7 @@ fi # If no command-line argument if [[ $# -eq 0 ]]; then - read -p "Are you sure you want to run ${smso}sqlite3${rmso} without a command-line argument (e.g., the filename of a database)? [y/N] " -r + read -p "$(_help "Are you sure you want to run \`sqlite3\` without a command-line argument (e.g., the filename of a database)? [y/N] ")" -r if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then exit 1 fi @@ -21,12 +17,12 @@ if [[ $# -eq 0 ]]; then elif [[ $# -eq 1 ]] && [[ ! "$1" =~ ^- ]]; then if [[ ! -f "$1" ]]; then if [[ ! "$1" =~ \.db$ ]]; then - read -p "Are you sure you want to create ${smso}$1${rmso}? SQLite filenames usually end in ${smso}.db${rmso}. [y/N] " -r + read -p "$(_help "Are you sure you want to create \`$1\`? SQLite filenames usually end in \`.db\`. [y/N] ")" -r if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then exit 1 fi else - read -p "Are you sure you want to create ${smso}$1${rmso}? [y/N] " -r + read -p "$(_help "Are you sure you want to create \`$1\`? [y/N] ")" -r if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then exit 1 fi diff --git a/opt/cs50/bin/valgrind b/opt/cs50/bin/valgrind index 2ed1e53..dd19aa8 100755 --- a/opt/cs50/bin/valgrind +++ b/opt/cs50/bin/valgrind @@ -1,12 +1,8 @@ #!/bin/bash -# Formatting -smso=$(tput smso) -rmso=$(tput sgr0) - # If run on Python program if [[ "$1" == "python" || "$1" == *.py ]]; then - echo "Afraid ${smso}valgrind${rmso} does not support Python programs!" + echo "$(_help "Afraid \`valgrind\` does not support Python programs!")" exit 1 fi From 3041bf96b7ed0c566444ab68b2661444a3d3eeb7 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Fri, 5 Jan 2024 22:48:22 -0500 Subject: [PATCH 12/15] added on/off --- etc/profile.d/help50.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/etc/profile.d/help50.sh b/etc/profile.d/help50.sh index 7a4b37e..3605fad 100644 --- a/etc/profile.d/help50.sh +++ b/etc/profile.d/help50.sh @@ -62,10 +62,12 @@ help50() { } _help50() { - if [[ -f "$HELPFUL" ]]; then - _helpful "$HELPFUL" - elif [[ -f "$HELPLESS" ]]; then - _helpless "$HELPLESS" + if [[ "$RUBBERDUCKING" != "0" ]]; then + if [[ -f "$HELPFUL" ]]; then + _helpful "$HELPFUL" + elif [[ -f "$HELPLESS" ]]; then + _helpless "$HELPLESS" + fi fi rm --force "$HELPFUL" "$HELPLESS" } @@ -77,4 +79,19 @@ _helpful() { _helpless() { :; } +duck() { + if [[ "$1" == "off" ]]; then + export RUBBERDUCKING=0 + elif [[ "$1" == "on" ]]; then + unset RUBBERDUCKING + elif [[ "$1" == "status" ]]; then + if [[ "$RUBBERDUCKING" == "0" ]]; then + echo "off" + else + echo "on" + fi + fi +} + export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }_help50" +duck on From a3c55b3c6425300740004974e700e9e7df826e74 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Tue, 9 Jan 2024 08:26:42 -0500 Subject: [PATCH 13/15] added icon to _help --- opt/cs50/bin/_help | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opt/cs50/bin/_help b/opt/cs50/bin/_help index fc7734b..7d6ef4f 100755 --- a/opt/cs50/bin/_help +++ b/opt/cs50/bin/_help @@ -10,4 +10,4 @@ else fi # https://www.gnu.org/software/termutils/manual/termutils-2.0/html_chapter/tput_1.html#SEC8 -echo "$input" | sed "s/\`\([^\`]*\)\`/$(tput smso)\1$(tput rmso)/g" +echo "⚠️ $input" | sed "s/\`\([^\`]*\)\`/$(tput smso)\1$(tput rmso)/g" From 7f315ae7500dbd7c6096531d401555432d6b4403 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Wed, 17 Jan 2024 13:39:15 -0500 Subject: [PATCH 14/15] WIP --- etc/profile.d/help50.sh | 13 +++++++++---- opt/cs50/bin/{_help => _ansi} | 2 +- opt/cs50/bin/_sure | 14 ++++++++++++++ opt/cs50/bin/http-server | 6 ++---- opt/cs50/bin/sqlite3 | 9 +++------ opt/cs50/lib/help50/bash | 13 +++++++++++++ typescript | 13 +++++++++++++ 7 files changed, 55 insertions(+), 15 deletions(-) rename opt/cs50/bin/{_help => _ansi} (73%) create mode 100755 opt/cs50/bin/_sure create mode 100755 opt/cs50/lib/help50/bash create mode 100644 typescript diff --git a/etc/profile.d/help50.sh b/etc/profile.d/help50.sh index 3605fad..92885c8 100644 --- a/etc/profile.d/help50.sh +++ b/etc/profile.d/help50.sh @@ -1,6 +1,11 @@ # Directory with helpers HELPERS="/opt/cs50/lib/help50" +# Disable yes, lest students type it at prompt +if command -v yes &> /dev/null; then + alias yes=":" +fi + # Temporary files FILE="/tmp/help50.$$" # Use PID to support multiple terminals HELPFUL="${FILE}.help" @@ -51,6 +56,7 @@ help50() { # Try to get help local helper="${HELPERS}/${command}" + echo "HELPER: $helper" if [[ -f "$helper" && -x "$helper" ]]; then local help=$("$helper" "$@" <<< "$output") fi @@ -64,17 +70,16 @@ help50() { _help50() { if [[ "$RUBBERDUCKING" != "0" ]]; then if [[ -f "$HELPFUL" ]]; then - _helpful "$HELPFUL" + _helpful "$(cat "$HELPFUL")" elif [[ -f "$HELPLESS" ]]; then - _helpless "$HELPLESS" + _helpless "$(cat "$HELPLESS")" fi fi rm --force "$HELPFUL" "$HELPLESS" } _helpful() { - echo -n "🦆 " - cat "$1" | _help + echo "$1" } _helpless() { :; } diff --git a/opt/cs50/bin/_help b/opt/cs50/bin/_ansi similarity index 73% rename from opt/cs50/bin/_help rename to opt/cs50/bin/_ansi index 7d6ef4f..fc7734b 100755 --- a/opt/cs50/bin/_help +++ b/opt/cs50/bin/_ansi @@ -10,4 +10,4 @@ else fi # https://www.gnu.org/software/termutils/manual/termutils-2.0/html_chapter/tput_1.html#SEC8 -echo "⚠️ $input" | sed "s/\`\([^\`]*\)\`/$(tput smso)\1$(tput rmso)/g" +echo "$input" | sed "s/\`\([^\`]*\)\`/$(tput smso)\1$(tput rmso)/g" diff --git a/opt/cs50/bin/_sure b/opt/cs50/bin/_sure new file mode 100755 index 0000000..74f688a --- /dev/null +++ b/opt/cs50/bin/_sure @@ -0,0 +1,14 @@ +#!/bin/bash + +if [[ $# -ne 1 ]]; then + exit 1 +fi +prompt=$(echo "$1" | _ansi) +while true; do + read -p "$prompt [y/N] " -r + if [[ "${REPLY,,}" =~ ^(y|yes)$ ]]; then + exit 0 + elif [[ "${REPLY,,}" =~ ^(n|no)$ ]]; then + exit 1 + fi +done diff --git a/opt/cs50/bin/http-server b/opt/cs50/bin/http-server index dcb9369..7bbcd9e 100755 --- a/opt/cs50/bin/http-server +++ b/opt/cs50/bin/http-server @@ -11,16 +11,14 @@ t="-t0" # Check for app.py or wsgi.py if [[ -f app.py ]] || [[ -f wsgi.py ]]; then - read -p "$(_help "Are you sure you want to run \`http-server\` and not \`flask\`? [y/N] ")" -r - if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then + if ! _sure "Are you sure you want to run \`http-server\` and not \`flask\`?"; then exit 1 fi fi # Check for path if [[ $# -eq 1 ]] && [[ $1 != -* ]] && [[ ! $1 =~ ^\./?$ ]]; then - read -p "$(_help "Are you sure you want to serve \`${1}\` and not your current directory? [y/N] ")" -r - if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then + if ! _sure "Are you sure you want to serve \`${1}\` and not your current directory?"; then exit 1 fi fi diff --git a/opt/cs50/bin/sqlite3 b/opt/cs50/bin/sqlite3 index d59bcd5..80557d8 100755 --- a/opt/cs50/bin/sqlite3 +++ b/opt/cs50/bin/sqlite3 @@ -8,8 +8,7 @@ fi # If no command-line argument if [[ $# -eq 0 ]]; then - read -p "$(_help "Are you sure you want to run \`sqlite3\` without a command-line argument (e.g., the filename of a database)? [y/N] ")" -r - if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then + if ! _sure "Are you sure you want to run \`sqlite3\` without a command-line argument (e.g., the filename of a database)?"; then exit 1 fi @@ -17,13 +16,11 @@ if [[ $# -eq 0 ]]; then elif [[ $# -eq 1 ]] && [[ ! "$1" =~ ^- ]]; then if [[ ! -f "$1" ]]; then if [[ ! "$1" =~ \.db$ ]]; then - read -p "$(_help "Are you sure you want to create \`$1\`? SQLite filenames usually end in \`.db\`. [y/N] ")" -r - if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then + if ! _sure "Are you sure you want to create \`$1\`? SQLite filenames usually end in \`.db\`."; then exit 1 fi else - read -p "$(_help "Are you sure you want to create \`$1\`? [y/N] ")" -r - if [[ ! "${REPLY,,}" =~ ^y|yes$ ]]; then + if ! _sure "Are you sure you want to create \`$1\`?"; then exit 1 fi fi diff --git a/opt/cs50/lib/help50/bash b/opt/cs50/lib/help50/bash new file mode 100755 index 0000000..f34adec --- /dev/null +++ b/opt/cs50/lib/help50/bash @@ -0,0 +1,13 @@ +#!/bin/bash + +output=$(cat) + +regex="bash: (.*).py: command not found" +if [[ "$output" =~ $regex ]]; then + + # If target is a directory + if [[ -f "$1" ]]; then + echo "Did you mean to run \`python ${1}`?" + exit + fi +fi diff --git a/typescript b/typescript new file mode 100644 index 0000000..e196aef --- /dev/null +++ b/typescript @@ -0,0 +1,13 @@ +Script started on 2024-01-09 14:43:54+00:00 [TERM="xterm" TTY="/dev/pts/0" COLUMNS="130" LINES="33"] +$ vi +[?1049h[>4;2m[?1h=[?2004h[?1004h[?12h[?12l▽ Pzz\[0%m [>c]10;?]11;? [No Name]  [?25l~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~  [No Name] CWD: /home/ubuntu Line: 0 VIM - Vi IMprovedversion 8.2.2121by Bram Moolenaar et al.Modified by team+vim@tracker.debian.orgVim is open source and freely distributableSponsor Vim development!type :help sponsor for information type :q to exit type :help or  for on-line helptype :help version8 for version info[?25h[?25l::[?25hq [?25l +[?2004l[>4;m[?1004l[?2004l[?1l>[?25h[>4;m[?1049l$ ls +Dockerfile etc foo.py index.js.patch LICENSE Makefile opt shell.c.patch tests tmp typescript +$ scrip^C +$ vi +[?1049h[>4;2m[?1h=[?2004h[?1004h[?12h[?12l▽ Pzz\[0%m [>c]10;?]11;? [No Name]  [?25l~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~  [No Name] CWD: /home/ubuntu Line: 0 VIM - Vi IMprovedversion 8.2.2121by Bram Moolenaar et al.Modified by team+vim@tracker.debian.orgVim is open source and freely distributableHelp poor children in Uganda!type :help iccf for information type :q to exit type :help or  for on-line helptype :help version8 for version info[?25h[?25l^M [?25h[?25l^M [?25h[?25la -- INSERT --[?25h+N o[No Name] [?25l          [+] CWD: /home/ubuntu Line: 2[?25h[?25l3 [?25h[?25l4 [?25h[?25l5 [?25h[?25l^[ [?25h[?25l::[?25hwq [?25lE32: No file name[?25h[?25ll [?25h[?25ls cl -- INSERT --[?25h[?25l^[ [?25h[?25l::[?25hwq! [?25lE32: No file name[?25h[?25l::[?25hw foo [?25l"foo" [New] 5L, 5B writtenfooN o ~/foo CWD: /home/ubuntu Line: 5 [?25h[?25l::[?25hq [?25l +[?2004l[>4;m[?1004l[?2004l[?1l>[?25h[>4;m[?1049l$ ls +Dockerfile etc foo foo.py index.js.patch LICENSE Makefile opt shell.c.patch tests tmp typescript +$ l  + +Script done on 2024-01-09 14:44:16+00:00 [COMMAND_EXIT_CODE="0"] From 5c70d230fa26a022e60a7a3b63cb4140aa0005c2 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Wed, 17 Jan 2024 13:40:41 -0500 Subject: [PATCH 15/15] WIP --- typescript | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 typescript diff --git a/typescript b/typescript deleted file mode 100644 index e196aef..0000000 --- a/typescript +++ /dev/null @@ -1,13 +0,0 @@ -Script started on 2024-01-09 14:43:54+00:00 [TERM="xterm" TTY="/dev/pts/0" COLUMNS="130" LINES="33"] -$ vi -[?1049h[>4;2m[?1h=[?2004h[?1004h[?12h[?12l▽ Pzz\[0%m [>c]10;?]11;? [No Name]  [?25l~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~  [No Name] CWD: /home/ubuntu Line: 0 VIM - Vi IMprovedversion 8.2.2121by Bram Moolenaar et al.Modified by team+vim@tracker.debian.orgVim is open source and freely distributableSponsor Vim development!type :help sponsor for information type :q to exit type :help or  for on-line helptype :help version8 for version info[?25h[?25l::[?25hq [?25l -[?2004l[>4;m[?1004l[?2004l[?1l>[?25h[>4;m[?1049l$ ls -Dockerfile etc foo.py index.js.patch LICENSE Makefile opt shell.c.patch tests tmp typescript -$ scrip^C -$ vi -[?1049h[>4;2m[?1h=[?2004h[?1004h[?12h[?12l▽ Pzz\[0%m [>c]10;?]11;? [No Name]  [?25l~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~  [No Name] CWD: /home/ubuntu Line: 0 VIM - Vi IMprovedversion 8.2.2121by Bram Moolenaar et al.Modified by team+vim@tracker.debian.orgVim is open source and freely distributableHelp poor children in Uganda!type :help iccf for information type :q to exit type :help or  for on-line helptype :help version8 for version info[?25h[?25l^M [?25h[?25l^M [?25h[?25la -- INSERT --[?25h+N o[No Name] [?25l          [+] CWD: /home/ubuntu Line: 2[?25h[?25l3 [?25h[?25l4 [?25h[?25l5 [?25h[?25l^[ [?25h[?25l::[?25hwq [?25lE32: No file name[?25h[?25ll [?25h[?25ls cl -- INSERT --[?25h[?25l^[ [?25h[?25l::[?25hwq! [?25lE32: No file name[?25h[?25l::[?25hw foo [?25l"foo" [New] 5L, 5B writtenfooN o ~/foo CWD: /home/ubuntu Line: 5 [?25h[?25l::[?25hq [?25l -[?2004l[>4;m[?1004l[?2004l[?1l>[?25h[>4;m[?1049l$ ls -Dockerfile etc foo foo.py index.js.patch LICENSE Makefile opt shell.c.patch tests tmp typescript -$ l  - -Script done on 2024-01-09 14:44:16+00:00 [COMMAND_EXIT_CODE="0"]