line breaks

From: Date: Tue, 25 Nov 2003 14:21:14 +0000
Subject: line breaks
Groups: php.general 
Request: Send a blank email to php-general+get-170884@lists.php.net to get a copy of this message
Greetings! I'm writing a script that will take the contents of a text file that has several lines of user accounts and creates a shell script with chown commands for each user in that text file. My problem is that when it writes the shell script file it puts a line break after the colon in between $buffer and html. How do I prevent this from doing that? Thanks, Rod Code: ----------------------------------------------------------------------- $fhandle = fopen ("/scripts/thescript.sh" , "a"); $handle = fopen ("/scripts/mail_list.txt", "r"); while (!feof ($handle)) { $buffer = fgets($handle, 1000);
             fwrite ($fhandle, "chown $buffer:html /scripts/var/spool/mail/$buffer\n", 4096);
} fclose ($handle); fclose ($fhandle);

« previous php.general (#170884) next »