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

Jim Kinney jim.kinney at gmail.com
Thu May 12 14:10:25 EDT 2011


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

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*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20110512/13204a08/attachment.html 


More information about the Ale mailing list