Skip to content

Instantly share code, notes, and snippets.

@dfdgsdfg
Last active April 28, 2016 10:20
Show Gist options
  • Save dfdgsdfg/96b14b77f718d941cc028a72751f2e86 to your computer and use it in GitHub Desktop.
Save dfdgsdfg/96b14b77f718d941cc028a72751f2e86 to your computer and use it in GitHub Desktop.
short_noob_question.fish
set -g items "item1" "item2" "item3"
function itme1
set -g item1_exists "false"
switch $argv
case check
if exists item1
set item1_exists "true"
end
case do
command item1
end
end
function do
for item in $items
/////////////////////////////////////////// How can I check
if test "$item"_exist = "true"
eval $item "do"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment