[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] scripts, file I/O, and loss of hair
- Subject: [ale] scripts, file I/O, and loss of hair
- From: jim.kinney at gmail.com (Jim Kinney)
- Date: Thu, 12 May 2011 14:10:25 -0400
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