Interact2Day, Inc.    Wednesday, February 26, 2020

>> USTCP cgiSuite <<

USTCP cgiSuite FAQs
UNIX (Linux, FreeBSD, et. al.) Technical Issues

INDEX:
  1. I am trying to copy the uncompressed ASCII text files directly from the provided floppy to my UNIX server and nothing seems to be working -- even from the command line.
  2. I FTP'd the ASCII text files as binary (or I forgot to set the transfer mode to "ascii") and none of the scripts seem to be working -- even from the command line!

 

  1. Q.    I am trying to copy the uncompressed ASCII text files directly from the provided floppy to my UNIX server and nothing seems to be working -- even from the command line.
    A.    Unless you are using files extracted from a UNIX TAR file, the default distribution method is Windows.  Because the overwhelming majority of our users will be installing these scripts from a Windows computer to either a Windows or a UNIX Web server, all of the non-TAR files are in Windows text format with Windows EOL (End of Line) encoding.  

    Normally, if the files are FTP'd to a Web server as "ascii" text files, the act of FTP'ing them will automatically convert the EOL characters to an encoding method suitable for the destination server.  If you skip the FTP method or if you FTP the files as "binary", however, this conversion will not take place and you may [likely] encounter problems if the destination server runs on a different family of Operating Systems (e.g. Windows to another Windows machine would be OK, but Windows to UNIX or Windows to Mac would not be).

    A number of possible fixes exist:

    1) Re-FTP the files as "ascii" files, replacing the incorrect versions of the files on the server.  This can even be done locally on a server by simply FTP'ing back into the Web server.
    2) Load the files into a text editor, such as "pico", that is intelligent enough to recognize and automatically convert the line endings to a proper form for the current OS.
    3) Use a simple Perl or shell script to convert the line endings.  A simple Perl script might look something like:
         #!/usr/bin/perl
         # win2unix.pl - simple script to convert Windows and Mac line endings to UNIX
         if (!$ARGV[0] || !$ARGV[1]) { 
            print "USAGE: perl win2unix.pl <source-file> <fixed-file>\n";
            exit 0; 
       
         }
         open (INPUT, $ARGV[0]) or die "Error opening $ARGV[0] for input. $!";
         open (OUTPUT, ">$ARGV[1]") or die "Error opening $ARGV[1] for output. $!";
         while (<INPUT>)  {
           $_ =~ s/\r\n|\n|\r/\n/g;
           print OUTPUT $_;
         }
         close (INPUT);
         close (OUTPUT) or die "Error closing $ARGV[1]. $!";

            On the command line type: 
    perl win2unix.pl sourcefile newfile    
  2. Q.    I FTP'd the ASCII text files as binary (or I forgot to set the transfer mode to "ascii") and none of the scripts seem to be working -- even from the command line!
    A.    See Question 1.  Basically the non-TAR text files in the distribution are stored in Windows text format and need to be converted to UNIX text format.

 

 
Review Interact2Day's Privacy Policy.

1996-2006 Interact2Day, Inc., All Rights Reserved.
All material on this site is subject to change or correction without notice.
Additional copyright and trademark statements.
Interact2Day and the Interact2Day Logo are registered trademarks of Interact2Day, Inc, Anderson, SC, USA.
Interact2Day, Inc., is a Florida registered Corporation headquartered in Anderson, South Carolina.
Interact2Day, Inc.