In a bash environment, if the statement
export FC="gfortran -O3 -ffree-line-length-none"
is added to the .bashrc file, then in a terminal, the command
$FC main.f90
will compile program main.f90
and produce an executable named a.out
.
This is a simple example but in general there might be more than two options passed to a program (gfortran
in this example).
If the above export statement is placed in a .zshrc file,
the command $FC main.f90
fails and gives the following msg:
zsh: command not found: gfortran -O3 -ffree-line-length-none
Is there a syntax in zsh that replicates what happens in bash or another way to do it in zsh?
Using a straightforward alias without the export as in
alias FC="gfortran -O3 -ffree-line-length-none"
FC main.f90
is the simplest solution and works for me. Thanks to Karnik Kanojia for the idea.