[ale] scripts, file I/O, and loss of hair
Geoffrey Myers
lists at serioustechnology.com
Fri May 13 07:37:44 EDT 2011
Jim Kinney wrote:
> I have a simple test script my_script
>
> #!/bin/bash
> # this is a crap script
> myout="$2"'.crap'
> directions=$(cat $2)
> echo "$myout"
> echo "$directions"
> exit
>
> It is launched by:
>
> ./my_script < test1.dat
You're not passing a $2 ???
>
> which is a file containing one line
> /tmp/
>
> which will be used later once the I/O issue is corrected.
> This is being done to replicate a much larger scenario
>
> When it is run, the output is:
> .crap
> /tmp/
>
> Notice that the file I want to be named test1.dat.carp is only named .crap
>
> I need to get the name of the input file into the script itself somehow.
> Positional parameters as not doing it.
>
> --
> --
> 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
--
Until later, Geoffrey
"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson
More information about the Ale
mailing list