Hi Trung, re: > I have the following line of code in a *.mac file. > > CALL SYSTEM('/home/dpis/mcidas/data/emailnote '//CSTAT) > > I would like to define an $ANCHOR with the above path value - > $ANCHOR=/home/dpis/mcidas/data and would like to have that $ANCHOR in > the CALL SYSTEM command. > > i.e. CALL SYSTEM('$ANCHOR/emailnote '//CSTAT) so the $ANCHOR will be > replaced by '/home/dpis/mcidas/data' at run time. > > How would I do that in Fortran? Not sure of what the syntax is. Thanks. Since expansion of references to environment variable (e.g., $ANCHOR) is done by the shell, I don't think that you will be able to do what you want to do in one step. Instead, you will need to: - call the Fortran library routine 'getenv' to get the value of your 'anchor' variable (environment variable) - run the comand using the library routine 'system' Here is some code that should approximate this: character*80 anchor integer len_trim integer length ... call getenv('ANCHOR', anchor) length = len_trim(anchor) call system(anchor(1:length)//'emailnote '//CSTAT) Cheers, Tom **************************************************************************** Unidata User Support UCAR Unidata Program (303) 497-8642 P.O. Box 3000 address@hidden Boulder, CO 80307 ---------------------------------------------------------------------------- Unidata HomePage http://www.unidata.ucar.edu **************************************************************************** Ticket Details =================== Ticket ID: UGB-430567 Department: Support McIDAS Priority: Normal Status: Closed
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.