[ale] scripts, file I/O, and loss of hair

Richard Bronosky Richard at Bronosky.com
Thu May 12 21:38:08 EDT 2011


That made me cringe more than a modern "horror movie" (or as Bruce
Campbell calls it "torture porn"). Because I understand exactly what
everyone of those commands are telling bash to do and what you are
doing wrong, it hurt me to watch. I would have thrown popcorn at the
screen if I had any.

On Thu, May 12, 2011 at 8:48 PM, Jim Kinney <jim.kinney at gmail.com> wrote:
>
>
> On Thu, May 12, 2011 at 6:45 PM, The Don Lachlan
> <ale-at-ale.org at unpopularminds.org> wrote:
>>
>> On Thu, May 12, 2011 at 05:57:42PM -0400, Jim Kinney wrote:
>> > that expects a {binary name} < {input data file}. {input data file} is
>> > variably named and often 20+MB. Changing {binary name} to work better is
>> > political (think Fortran 77 base code - someone in charge got their PhD
>> > with
>> > that program).
>> > so things must work as they are with my little tweaks around the edges.
>> > until I blow away the decades old mess and start over in C.
>>
>> That doesn't make any sense.
>>
>> If the Fortran code expects the data as a stream (that's what the redirect
>> does), then why are you trying to get the file name in a shell script?
>> What
>> is your objective with this?
>
> For logging the combination of which fortran binary with which input file
> I'm simulating parts of a process with a shell script. The fortran code runs
> for many hours.
>
> FYI:
>
>      shell variable redirect
>
> fred='foo bar'
> mary=`<${fred}`
> -bash: ${fred}: ambiguous redirect
>
> mary=`cat ${fred}`
> cat: foo: No such file or directory
> cat: bar: No such file or directory
>
>     get contents of variable
> mary=`echo ${fred}`
> echo $mary
> foo bar
>
>     make a file
> echo "foo bar" >> fred
> mary=$(<$fred)
> -bash: $fred: ambiguous redirect
>
>
>    read file
> cat fred
> foo bar
>
>
>     redirect file contents to shell variable
>  mary=`<$fred`
> -bash: $fred: ambiguous redirect
>
>
>    create a reference (as shell var) to file to have redirect "go through"
> john='fred'
> mary=`<${john}`
> echo $mary
> foo bar
>
>
>     or just 'cat' the damn thing and irritate R. Schwartz again :-)
> suzy=$(cat ${john})
> echo $suzy
> foo bar
>
> some days computers just suck.
>
>
>>
>> -L
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>
>
>
> --
> --
> James P. Kinney III
>
> As long as the general population is passive, apathetic, diverted to
> consumerism or hatred of the vulnerable, then the powerful can do as they
> please, and those who survive will be left to contemplate the outcome.
> - 2011 Noam Chomsky
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>



-- 
.!# RichardBronosky #!.



More information about the Ale mailing list