Thread: Shell Broken ?
08-26-2006, 06:48 PM #1A.I. BOTGuestShell Broken ?
I recently switched from Linux to Mac. I was making a shell script. I loaded it up on my browser and it gave me a 500 error. I checked my logs, it said Premature end of script headers. This script did work on my Linux.
So I made a new little script with something as simple as:
#!/bin/sh echo Content-Type: text/html echo echo Hello!
$ sh test.sh echoent-Type: text/html
$ sh test.sh Content-Type: text/html Hello!
08-26-2006, 08:37 PM #2
- Member Since
- Aug 04, 2006
- Windsor, Ontario (Canada)
- 2.16 Ghz MacbookPro, 1GB RAM, Radeon X1600, 100GB Hard Disk
I don't know what is wrong, but I can confirm that something is wrong.
adrian-petrescus-computer:~ adrianpetrescu$ vim test.sh adrian-petrescus-computer:~ adrianpetrescu$ chmod a+x test.sh adrian-petrescus-computer:~ adrianpetrescu$ ./test.sh Content-Type: text/html Hello!
08-27-2006, 07:09 PM #3A.I. BOTGuest
So is there anything I can do about it :/ ?
08-28-2006, 01:32 PM #4
- Member Since
- Dec 24, 2002
- Los Angeles, California
- 2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi
I don't know about everyone else, but this is the way I would write it.
echo "Content-Type: text/html\n"
echo "Hello!"Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By AppleCider in forum iOS and AppsReplies: 2Last Post: 07-21-2012, 06:10 PM
By Mr.Scade in forum Apple DesktopsReplies: 5Last Post: 08-20-2010, 01:42 PM
By Kurt53 in forum OS X - Development and DarwinReplies: 1Last Post: 10-21-2008, 11:34 PM
By Ricerind in forum Apple NotebooksReplies: 8Last Post: 08-27-2008, 01:58 PM
By AlexN in forum OS X - Operating SystemReplies: 2Last Post: 09-17-2005, 07:08 PM