Skip to content

Instantly share code, notes, and snippets.

@x-stp
Created July 25, 2025 19:54
Show Gist options
  • Select an option

  • Save x-stp/940d5c211258de10984905323b599f52 to your computer and use it in GitHub Desktop.

Select an option

Save x-stp/940d5c211258de10984905323b599f52 to your computer and use it in GitHub Desktop.
whence -v tee tail sed awk
print "PATH=$PATH"
[[ -x /usr/linux/bin/tee ]] && PATH=/usr/linux/bin:$PATH
[[ -x /opt/freeware/bin/tee ]] && PATH=/opt/freeware/bin:$PATH
#
while IFS= read -r line; do
[[ $line == *Error\ 2* ]] && print "FOUND: $line"
done < /tmp/sigh.txt
#
set -A lines $(< sigh.txt)
integer i=${#lines[@]}-100
while (( i < ${#lines[@]} )); do
print "${lines[i]}"
(( i++ ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment