On Mon, May 6, 2013 at 9:27 AM, Rudolf Sykora rudolf.syk...@gmail.com wrote:
Can the rc example be modified --- still using a here document --- so
that it works?
I guess I must be missing something, but this seems equivalent to your
bash script:
for(i in 1 2 3) {
cat !
$i
!
}
I guess I must be missing something, but this seems equivalent to your
bash script:
for(i in 1 2 3) {
cat !
$i
!
}
clearly you did not run this script. this doesn't
work for the same reason that here docs in functions
don't work.
- erik
On Wed, May 8, 2013 at 12:08 AM, erik quanstrom quans...@quanstro.net wrote:
I guess I must be missing something, but this seems equivalent to your
bash script:
for(i in 1 2 3) {
cat !
$i
!
}
clearly you did not run this script. this doesn't
work for the same reason that here
clearly you did not run this script. this doesn't
work for the same reason that here docs in functions
don't work.
I actually did, but accidentally ran the old unix port. sorry for the noise.
ah, yes byron did make here documents work, and i think paul
goaded him into adding here
Hello,
so I repeat my question. While this is possible in bash:
;cat aBash
for i in 1 2 3
do
cat !
$i
!
done
;
;bash aBash
1
2
3
;
it doesn't work in rc:
;cat aRc
for(i in 1 2 3) {
cat !
}
$i
!
;
;rc aRc
;
Is this as it should be?
Can the rc example be modified --- still using a
Can the rc example be modified --- still using a here document --- so
that it works?
no.
- erik
Hello,
I have a problem with writing correctly a here document in rc.
I wrote, say:
s = (1 2)
for(i in $s) {
mkdir -p $i
cp POSCAR $i
@{
cd $i
ed POSCAR EOF [2]/dev/null
}
}
2c
$i
.
w
q
EOF
and I wanted to have the 2nd line of
s = (1 2)
for(i in $s) {
mkdir -p $i
cp POSCAR $i
@{
cd $i
ed POSCAR EOF [2]/dev/null
}
}
2c
$i
.
w
q
i usually solve this problem like this
for(i in 1 2){
mkdir -p $i || fatal
cp POSCAR $i
On 2 May 2013 17:24, erik quanstrom quans...@quanstro.net wrote:
i usually solve this problem like this
for(i in 1 2){
mkdir -p $i || fatal
cp POSCAR $i || fatal
@{
{
echo 2c