Operating System - Linux
1752590 Members
2964 Online
108788 Solutions
New Discussion юеВ

Re: identifying any invalid char in a file.

 
skt_skt
Honored Contributor

identifying any invalid char in a file.

1:-

adedd03n:root [/opt/local/unix/eracc/var/eracc] ll ediemerg
-rw------- 8 root sys 1 Dec 6 12:03 ediemerg
adedd03n:root [/opt/local/unix/eracc/var/eracc] cat ediemerg
kumarts
adedd03n:root [/opt/local/unix/eracc/var/eracc] od -cx ediemerg
0000000 6b75 6d61 7274 730a
k u m a r t s \n
0000010

2:-

adedd03n:root [/opt/local/unix/eracc/var/eracc] od -cx /opt/local/unix/eracc/var/eracc/ediemerg
0000000 6b75 6d61 7273 3130 0a00
k u m a r s 1 0 \n
0000011
adedd03n:root [/opt/local/unix/eracc/var/eracc] ll ediemerg
-rw------- 1 root sys 9 Dec 6 12:00 ediemerg
adedd03n:root [/opt/local/unix/eracc/var/eracc] od -cx /opt/local/unix/eracc/var/eracc/ediemerg
0000000 6b75 6d61 7273 3130 0a00
k u m a r s 1 0 \n
0000011
adedd03n:root [/opt/local/unix/eracc/var/eracc] cat /opt/local/unix/eracc/var/eracc/ediemerg
kumars10

I this scenario i am getting "invlaid control file format". It happens only to the use kumars10 and which have a 8 char while other working users have only 7 char user id, like kumarts.

so i am looking for any hidden enrties or some thing which i am not able to identify and which could cause an error reported

here is the binary i use to enable/disable the id.When enabled the control file (/opt/local/unix/eracc/var/eracc/ediemerg) occupies a particular user id and when disabled it become a blank line file with file size 1.

here is the binary i use to enable/disable the id.

adedd03n:root [/opt/local/unix/eracc/var/eracc] ll
total 2
-rw------- 1 root sys 1 Dec 6 12:03 ediemerg
adedd03n:root [/opt/local/unix/eracc/var/eracc] cat ediemerg



adedd03n:root [/opt/local/unix/eracc/bin] file eracc
eracc: PA-RISC1.1 shared executable dynamically linked
adedd03n:root [/opt/local/unix/eracc/bin] what eracc
eracc:

I am not sure if that binary is some thing which HP supports or provided by HP.

any suggetions would be appreciated.
3 REPLIES 3
skt_skt
Honored Contributor

Re: identifying any invalid char in a file.

i have posted this to HP_UX forum .. any tips from Linux experts also welcome.
palaniappan.sp
Regular Advisor

Re: identifying any invalid char in a file.

Hi,
Did u tried this command??

#cat -v
The above command will be used to see the characters which are able to see by the human eye (i.e) when ur r doing cat
Especially the above command we used for finding the windows characters in a file eg:- ^M,^x...etc

Regds
Palani


Everything is Possible and Anything is Feasible if u try
skt_skt
Honored Contributor

Re: identifying any invalid char in a file.

it was a bug in the code in the c program.

Wrong:
/* read one line from control file */
fgets(readbuf,MAXLNLEN+1,fd);
fclose(fd);

Fixed:
/* read one line from control file */
fgets(readbuf,MAXLNLEN+2,fd);
fclose(fd);