I'm trying to gather user input in a fish shellscript, particularly of the following oft-seen form:
This command will delete some files. Proceed (y/N)?
After some searching around, I am still not sure how to do this cleanly.
Is these a special way of doing this in fish?
-p
can be any shell command, which will get tokenized as you might expect at spaces, e.g.echo "Delete Files? [Y/n]: "'
From the doc you linked: "-p PROMPT_CMD or --prompt=PROMPT_CMD uses the output of the shell command PROMPT_CMD as the prompt for the interactive mode. The default prompt command isset_color green; echo read; set_color normal; echo "> "
– Waxplant