tags:

views:

17

answers:

1

I read the script from clipboard:// and write it to a linux ftp server:

#!/home/myaccount/cgi-bin/rebol -c
Rebol []

mywhois: func[thedomain /local whois][

    whois: read rejoin [whois:// thedomain "@" "whois.internet.bs"]
    parse whois [to "Expiry Date: " thru "Expiry Date: " copy Expiry-Date to newline]
    Expiry-Date
]

parse system/script/path [thru "/" thru "/" thru "/"  copy domain to "/"]
expiration-date: mywhois domain
info: rejoin ["Expiration of " domain ": " expiration-date]
print info
print "<br>"
print rejoin ["IP Lookup: " read rejoin [dns:// domain]]
print ""

When I chmod this file to 755, the cgi doesn't work, whereas it works when I upload it with a ftp software.

A: 

If the same script works when uploaded via ftp, but doesn't work when copied another way, then they are not the same. You have to check to remove tabs and to make sure line endings are the same.

Graham Chiu
I copied the file content to the clipboard so It should have been the same. If I paste what I copied in notepad and upload it to ftp, it works so why would rebol behaves differently ?
Rebol Tutorial
Because they are not the same. Do a diff on the two files.
Graham Chiu