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

Re: string to array space problem in filenames



On 09/03/2015 09:11 AM, Ray Andrews wrote:
On 09/03/2015 08:30 AM, Mikael Magnusson wrote:


Ah, one more thing:

    input=( ${(f)"$(<~/.dirstack)"} )



... as Bart showed, works fine, however the function that does the sorting and compressing I like available for other things, so I want to be able to use an argument there. While I was using the 'single line' version, like this:

    input=(${=@})

... and the function itself called like this:

  compress_function `cat ~/.dirstack`

... but it no longer works with the 'newline' form. So how do I take input
from an argument now?


  Therewego:

    compress_function `cat ~/.dirstack`
... is moronic.

    compress_function ~/.dirstack

...to pass the filename, and:

    input=( ${(f)"$(<$@)"} )

... to grab the contents of the file. I won't say it's simple, but it sorta makes
sense.



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