* smart input
@ 2018-03-27 23:32 Ray Andrews
0 siblings, 0 replies; only message in thread
From: Ray Andrews @ 2018-03-27 23:32 UTC (permalink / raw)
To: Zsh Users
I have a function that takes input from a file like so:
input=( ${(f)"$(<$@)"} ) # Read the contents of file
I know how to modify that to accept input from an array, but would it be
possible to make it smart? That is, to accept input from either a file
or an array as the case may be? I have some ideas like: " [ -e ... ] "
to test if the argument is infact a filename, but is there some elegant
method?
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-03-27 23:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-27 23:32 smart input Ray Andrews
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).