Skip to content

Instantly share code, notes, and snippets.

@chantra
Created September 30, 2022 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chantra/6a7c526f45f833da7eb7d08b053757d8 to your computer and use it in GitHub Desktop.
Save chantra/6a7c526f45f833da7eb7d08b053757d8 to your computer and use it in GitHub Desktop.
#!/bin/bash
_ARG1=""
_ARG2=""
function foo() {
set -x
ls "${_ARG1}" "${_ARG2}"
set +x
}
_ARG1="-l"
_ARG2=""
foo
_ARG2="$(readlink -f $0)"
foo
@chantra
Copy link
Author

chantra commented Sep 30, 2022

$ /tmp/a.sh
+ ls -l ''
ls: cannot access '': No such file or directory
+ set +x
+ ls -l /tmp/a.sh
-rwxr-xr-x. 1 chantra chantra 162 Sep 30 14:03 /tmp/a.sh
+ set +x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment