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

Re: convolutions



On Nov 7,  8:09am, Ray Andrews wrote:
} Subject: Re: convolutions
}
} $ . ./test: test2
} 12345678-10-345678-20-345678-30-345678-40-345678-50-345678-60-345678-70-345678-80-345678-90-345678-100
} 
} [ in glorious color: ]
} 
} 10-345678-20-345678-30-345678-40-345678-50-345678-60-345678-70-345678-80-345678-90-345678-100

[...]

} working here, tho the first part of my 'measuring string' is cut off for 
} some reason.

    "\${$(cat junk1)}"

becomes

    ${12345678-...}

which is the syntax for "the 12345678th positional parameter, or if that
is not set, then ..." and your expansion "works" entirely by accident
but lops off the 12345678 from the front.

So your stress test isn't anywhere near as stressful as you thought.

} But I would like some way of performing 
} expansions inside a file without any gottchas.  Surely that's simple at 
} least to verbalize:
} 
}      $ cat in_file | expand_all_parameters > out_file

There's no shell operation for "expand parameters but not any of the
other kinds of expansions you know about."  If what you want is some
kind of text replacement, you should be writing in_file in a text
processing language (HTML maybe?) rather than in shell syntax.



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