I have created the following test1.csh and test2.csh to debug an error from link_grib.csh which is a .csh script that comes from a climate simulation software package called WRF.
I do not have superuser access on this Linux server. The provided script has run fine for a superuser on the same server so no modification should be needed.
I broke out two simple snippets from link_grib.csh, one involving foreach, and the other involving symbolic link and illustrates the output I am seeing, please see my questions below.
1) Test1.csh
#!/bin/csh
echo ${1}
foreach f ( ${1}* )
end
Output:
[frank@simunec1 20130604_mini]$ ls ./FNL.dat
./FNL.dat
[frank@simunec1 20130604_mini]$ test1.csh ./FNL.dat
./FNL.dat
foreach: No match.
Question: Why would foreach return no match here?
2) Test2.csh
#!/bin/csh
ln -sf ./FNL.dat GRIBFILE.AAA
Output:
[frank@simunec1 20130604_mini]$ test2.csh
[frank@simunec1 20130604_mini]$ ls GRIBFILE.AAA
ls: cannot access GRIBFILE.AAA: No such file or directory
// but running the same command outside of .csh script, everything is fine
[frank@simunec1 20130604_mini]$ ln -sf ./FNL.dat GRIBFILE.AAA
[frank@simunec1 20130604_mini]$ ls GRIBFILE.AAA
GRIBFILE.AAA
Question: Why does running the same command outside of .csh script works.