i am new player in linux
what does mean ">& and >&!" in script or command line?
thanks
Hmm. Could you please post an example full command for each one. As they stand
>& as a command generates a syntax error, >&! is an airball (Bash 4) doing nothing all by itself on a line. Not a syntax error.
for example in this command
csh Make_all.com >&! Make_all.log
from this script
#!/bin/csh
#set echo
#
# --- Usage: ./Make_all.com >& Make_all.log
# --- but first edit ./Make_all.src for this machine.
# --- also need correct ./bin/ncargf90 for plot/src programs.
#
# --- make all HYCOM pre/post processing executables,
# --- except those in archive/src/Make_ncdf.com that require NetCDF
#
# --- set ARCH to the correct value for this machine.
#
source Make_all.src
#
printenv ARCH
#
if (! -e ./config/${ARCH}_setup) then
echo "ARCH = " $ARCH " is not supported"
exit 1
endif
#
setenv A $cwd
#
foreach d ( archive force meanstd plot relax sample subregion topo )
echo "PROCESSING ${d}/src:"
cd ${A}/${d}/src
csh Make_all.com >&! Make_all.log
cat Make_all.log
end
#
# ./bin/Make_all.com does not use Make_all.src, but
# should not need editing for any supported machine type.
#
echo "PROCESSING bin:"
cd ${A}/bin
csh Make_all.com >&! Make_all.log
cat Make_all.log
Okay - thank you. You are using the c shell (csh) not bash.
Generally, experienced coders tend to avoid the c shell, because it has some issues, and I have not looked at it for too many years. Someone else can help you.
According to
man tcsh
command >& file redirects the standard output and error messages to the file.
An additional ! normally has no effect, unless there was a previous set noclobber (that is inhibited then).