I doubt that the bash read command will work with binary data. -----Original Message----- From: Post, Mark K [mailto:[EMAIL PROTECTED] Sent: Thursday, July 15, 2004 11:17 AM To: [EMAIL PROTECTED] Subject: Re: Bash script question
If you remove all the Windows line-endings, you won't need your workaround. If the file gets periodically re-created and uploaded, you can either: Do an ASCII transfer, which will also remove the Windows line-endings Do a binary transfer and leave your workaround in place. Obviously, the first case assumes that there isn't any true binary data in the file. If there is, then you really don't have much choice. Mark Post -----Original Message----- From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, July 15, 2004 2:13 PM To: [EMAIL PROTECTED] Subject: Re: Bash script question It was originally created on a windows system. -----Original Message----- From: Post, Mark K [mailto:[EMAIL PROTECTED] Sent: Thursday, July 15, 2004 11:00 To: [EMAIL PROTECTED] Subject: Re: Bash script question Tell me, was the file being read created on a Windows system, or a Linux/UNIX system? (I'm guessing Windows.) Mark Post -----Original Message----- From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, July 15, 2004 1:50 PM To: [EMAIL PROTECTED] Subject: Re: Bash script question The variable is valued using the following statement read _PRINTQ _PRTENBL _PRTURI _PRTDESC _BLDING _LOCDESC _PPDLOC _PAGESIZE The \r is not apart of the file being read. The file read has 8 fields and PAGESIZE is the last one. It seems to be that \r is a part of the carriage return / line-feed. As a work around, I appended another field to each record and I don't see the \r when I debug the script. It is now working as expected. Does this make sense? Also, if I simply echo $_PAGESIZE is does not display the \r -----Original Message----- From: Post, Mark K [mailto:[EMAIL PROTECTED] Sent: Thursday, July 15, 2004 10:14 To: [EMAIL PROTECTED] Subject: Re: Bash script question It's not that \r was appended to the if clause, it is that the value of the _PAGESIZE variable is: 'NONE\r' as opposed to this: NONE\r How that variable gets that value assigned to it is unknown, since you don't show that section of the code. Mark Post -----Original Message----- From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, July 15, 2004 12:59 PM To: [EMAIL PROTECTED] Subject: Bash script question I have cut some lines of code out of a bash script I am trying to execute. <snip> T2="NONE" T1=$_PAGESIZE if [ "$T2" = "$T1" ]; then <snip> I ran this using the -x option at the start of the script for debugging and it produced the following results. + T2=NONE + T1=NONE + '[' NONE = $'NONE\r' ']' Will someone please help me understand why the "\r" was appended to the if clause? And how can I change this code to make this a valid compare. If needed, I will be happy to provide more information. TIA Doug ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390