concatenation - Concatenate strings, files and program output in Bash -


the use case is, in case, css file concatenation, before gets minimized. concat 2 css files:

cat 1.css 2.css > out.css 

to add text @ one single position, can do

cat 1.css <<somestuff 2.css > out.css end in middle. somestuff 

to add stdout one other program:

sed 's/foo/bar/g' 3.css | cat 1.css - 2.css > out.css 

so far good. regularly come in situations, need mix several strings, files , program output together, copyright headers, files preprocessed sed(1) , on. i'd concatenate them in little steps , temporary files possible, while having freedom of choosing order.

in short, i'm looking way in little steps possible in bash:

command [string|file|output]+ > concatenated # note plus ;-) --------^ 

(basically, having cat handle multiple stdins sufficient, guess, like

<(echo "foo") <(sed ...) <(echo "bar") cat 1.css -echo1- -sed- 2.css -echo2- 

but fail see, how can access those.)

this works:

cat 1.css <(echo "foo") <(sed ...) 2.css <(echo "bar") 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -