Code Comments
Programming Forum and web based access to our favorite programming groups.Hello, I am porting code to SGI Unix which I believe was written on a Vax machine. The code has many inclusions such as : INCLUDE '\..\path\file.cb' f77 doesn't like the reverse slash. How can I compile it? Am I stuck with going into every file and reversing the direction of the slash. Thank you, Christopher Lusardi
Post Follow-up to this messageclusardi2k@aol.com wrote: > Hello, > > I am porting code to SGI Unix which I believe was written on a > Vax machine. The code has many inclusions such as : > > INCLUDE '\..\path\file.cb' I assume that since unix wants forward slashes, and assuming that you have the same directory structure, just change them to forward slashes. However, it seems unlikely that you have the same directory structure so you need to replace the quoted section with whatever the filename (and path) equivalent is on your SGI system. The slashes just delineate the components of the directory structure. If all the files are under the "default" include directory, you may be able to just remove everything but the filename (file.cb). > > f77 doesn't like the reverse slash. How can I compile it? > > Am I stuck with going into every file and reversing the > direction of the slash. > > Thank you, > Christopher Lusardi > -- Gary Scott mailto:garyscott@ev1.net Fortran Library: http://www.fortranlib.com Support the Original G95 Project: http://www.g95.org -OR- Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html Why are there two? God only knows. If you want to do the impossible, don't hire an expert because he knows it can't be done. -- Henry Ford
Post Follow-up to this messageclusardi2k@aol.com wrote:
> ...
> Am I stuck with going into every file and reversing the
> direction of the slash.
You could try automating the editing. Try something like:
ls -1 *.f | xargs -i -t \
ex -c "1,\$s?..\path\\\?../path/" +wq {}
The above works for sh/ksh. For csh/tcsh you may need to protect
the braces from the shell with backslashes too.
ls -1 *.f | xargs -i -t \
ex -c "1,\$s?..\path\\\?../path/" +wq \{\}
Walt
-...-
Walt Spector
(w6ws at earthlink dot net)
Post Follow-up to this messageIn article <1116761953.108061.155700@g49g2000cwa.googlegroups.com>, clusardi2k@aol.com wrote: > Hello, > > I am porting code to SGI Unix which I believe was written on a > Vax machine. The code has many inclusions such as : > > INCLUDE '\..\path\file.cb' > > f77 doesn't like the reverse slash. How can I compile it? > > Am I stuck with going into every file and reversing the > direction of the slash. > > Thank you, > Christopher Lusardi On SGI/IRIX, paths use forward slashes not backslashes. Change all the "\" to "/".
Post Follow-up to this messageGary L. Scott wrote: > clusardi2k@aol.com wrote: This seems strange. It is usual to use forward slash in C #include statements, as the DOS/Windows file system will accept them. (It is only the command line interpreter that doesn't.) VMS has a different way of indicating paths using [] and other characters. > I assume that since unix wants forward slashes, and assuming that you > have the same directory structure, just change them to forward slashes. > However, it seems unlikely that you have the same directory structure > so you need to replace the quoted section with whatever the filename > (and path) equivalent is on your SGI system. A relative path could easily be the same, an absolute path likely would be different. I can't say this look like either. There are automated ways to make the change, under unix the sed command would often be used to do this. -- glen
Post Follow-up to this messageglen herrmannsfeldt wrote: > > Gary L. Scott wrote: > > > > > This seems strange. It is usual to use forward slash in C #include > statements, as the DOS/Windows file system will accept them. (It is > only the command line interpreter that doesn't.) VMS has a different > way of indicating paths using [] and other characters. > > > A relative path could easily be the same, an absolute path likely > would be different. I can't say this look like either. > Another way: Most Fortran compilers seem to allow you to specify the path to include files via a command-line option (like -I). If you can use that there is no need to put in relative paths ... Regards, Arjen
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.