I have a question about what I think is an operator or argument passer but google hasn’t turned up anything. The script this is contained in is
#!/bin/sh
ln mopac.in FOR005
mopac >& FOR006
mv FOR006 mopac.out
When I call “mopac mopac.in”, the program runs fine, but, for my needs, mopac is called within another program by using this script, but it seems like the input file is failing to pass so mopac is not running. I don’t understand what the “>&” is supposed to do so I am having problems troubleshooting.
Thanks.
>& FILEis deprecatedbash(fromcsh) shorthand for> FILE 2>&1, that is, redirect both standard output and standard error. (If/bin/shis notbash, as is true on a number of Linux distributions, this will elicit an error.) Olderbash(before 3.0) preferred this form, so most newerbashstill understand it, although possibly very recentbashhas finally removed it as they seem to finally be removing deprecated constructs of late.Your script there is not passing
mopac.inat all, but appears to be assuming thatmopacwill read its input fromFOR005, so useslnto make it available there. Perhaps you should change the script to readmopac.inas a parameter, just as you’re running it directly.