Skip to content

Instantly share code, notes, and snippets.

View richiethomas's full-sized avatar

Richie Thomas richiethomas

  • Remote
View GitHub Profile
#!/usr/bin/env bash
echo "size of PATH: ${#PATH[@]}"
IFS=: paths=($PATH)
echo "size of PATH: ${#paths[@]}"
#!/usr/bin/env bash
foo0="$(ps -p "$PPID" -o 'args=' 2>/dev/null || true)"
echo "foo0: $foo0"
#!/usr/bin/env bash
command="${1:-foo}"
echo "$command"
@richiethomas
richiethomas / foo
Last active September 19, 2023 11:07
#!/usr/bin/env bash
command="${1:-}"
echo "$command"
#!/usr/bin/env fish
function foo
echo "argv: $argv"
echo "argv[1]: $argv[1]"
echo "argv[2]: $argv[2]"
echo "argv[3]: $argv[3]"
end
foo bar baz buzz
ls() {
echo "Hello world"
}
#!/usr/bin/env fish
function foo
echo "old argv: $argv"
set -e argv[1]
echo "new argv: $argv"
exit
end
foo $argv
@richiethomas
richiethomas / foo
Last active September 18, 2023 15:07
#!/usr/bin/env fish
function foo
echo "argv: $argv"
echo "argv[0]: $argv[0]"
echo "argv[1]: $argv[1]"
echo "argv[2]: $argv[2]"
echo "argv[3]: $argv[3]"
end
#!/usr/bin/env bash
export FOO="foo bar baz"
#!/usr/bin/env bash
echo "Hello world"