System i: Programming i5/OS PASE - IBM
System i: Programming i5/OS PASE - IBM
System i: Programming i5/OS PASE - IBM
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Example 1<br />
In this example, the shell does a character comparison of the generic name prefix against what is<br />
returned by readdir(). However, the QSYS.LIB file system returns directory entries in uppercase, so none<br />
of the entries matches the lowercase generic name prefix.<br />
$ ls -d /qsys.lib/v4r5m0.lib/qwobj*<br />
/qsys.lib/v4r5m0.lib/qwobj* not found<br />
$ ls -d /qsys.lib/v4r5m0.lib/QWOBJ*<br />
/qsys.lib/v4r5m0.lib/QWOBJ.FILE<br />
Example 2<br />
This example is similar to the first example except that, in this case, the find utility is doing the<br />
comparison, and not the shell.<br />
$ find /qsys.lib/v4r5m0.lib/ -name 'qwobj*' -print<br />
$ find /qsys.lib/v4r5m0.lib/ -name 'QWOBJ*' -print<br />
/qsys.lib/v4r5m0.lib/QWOBJ.FILE<br />
Example 3<br />
The ps utility expects user names to be case-sensitive and therefore does not recognize a match between<br />
the uppercase name specified for the -u option and lowercase names returned by the <strong>i5</strong>/<strong>OS</strong> <strong>PASE</strong><br />
runtime function getpwuid():<br />
$ ps -uTIMMS -f<br />
UID PID PPID C STIME TTY TIME CMD<br />
$ ps -utimms -f<br />
UID PID PPID C STIME TTY TIME CMD<br />
timms 617 570 0 10:54:00 - 0:00 /QOpenSys/usr/bin/-sh -i<br />
timms 660 617 0 11:14:56 - 0:00 ps -utimms -f<br />
Related information<br />
File system comparison<br />
Line-terminating characters in integrated file system files<br />
The AIX and <strong>i5</strong>/<strong>OS</strong> operating systems use different line-terminating characters in text files; for example,<br />
in files and shell scripts.<br />
The AIX applications that are the source for your <strong>i5</strong>/<strong>OS</strong> <strong>PASE</strong> programs expect that lines (for example, in<br />
files and shell scripts) will end with a line feed (LF). However, PC software and typical <strong>i5</strong>/<strong>OS</strong> software<br />
often ends lines with a carriage return and line feed (CRLF).<br />
awk '{ gsub( /\r$/, "" ); print $0 }' < oldfile > newfile<br />
CRLF used with FTP<br />
One example of where this difference can cause problems is when you use File Transfer Protocol (FTP) to<br />
transfer source files and shell scripts from the AIX operating system to the <strong>i5</strong>/<strong>OS</strong> operating system. The<br />
FTP standard calls for data sent in text mode to use carriage return and line feed (CRLF) at the end of a<br />
line. On AIX, the FTP utility removes carriage returns (CRs) when it processes an inbound file in text<br />
mode. <strong>i5</strong>/<strong>OS</strong> FTP always writes exactly what is presented in the data stream and always retains CRLF for<br />
text mode, which causes problems with the <strong>i5</strong>/<strong>OS</strong> <strong>PASE</strong> run time and utilities.<br />
Where possible, use binary mode transfer from an AIX operating system to avoid this problem. Text files<br />
transferred from personal computers will, in most cases, have CRLF delimiting lines in the file.<br />
Transferring the files first to AIX will correct the problem. The following command can be used as a<br />
means to remove the CR from files in the current directory:<br />
awk '{ gsub( /\r$/, "" ); print $0 }' < oldfile > newfile<br />
<strong>i5</strong>/<strong>OS</strong> <strong>PASE</strong> 15