Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

smart input



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?




Messages sorted by: Reverse Date, Date, Thread, Author