Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Unix newbie here, installing MYSQL.

Per the directions from the server admin, I just added two lines to the end of my .cshrc file to create 2 new environment variables:

setenv MYSQL_UNIX_PORT /home/userX/mysql.sock
setenv MYSQL_TCP_PORT 11023

Next the instructions say

Then do a 'source .cshrc' for the changes you just made.

This is the result:

server.edu(45): source .cshrc
: Command not found.
exit: Badly formed number.

What is the error? Why is the command not found?

Any help is greatly appreciated.

Thank You.

    #
    # $Header: /src/common/usc/skel/RCS/dot.cshrc,v 1.5 1994/06/20 20:48:05 ucs Exp $
    #

    #
    # If this is not an interactive shell, then we exit here.
    #
    if (! $?prompt) then
        exit 0
    endif

    #
    # RC Revision Date
    #
    set rcRevDate=930824

    #
    # Set User Level of expertise.
    #
    set UserLevel=novice

    ###############################################################################
    #
    # Source a global .cshrc file.  
    #
    # DO NOT DELETE THIS SECTION!
    #
    # If you wish to customize your own environment, then add things AFTER
    # this section.  In this way, you may override certain default settings,
    # but still receive the system defaults.
    #
    if (-r /usr/lsd/conf/master.cshrc) then
        source /usr/lsd/conf/master.cshrc
    else if (-r /usr/local/lib/master.cshrc) then
        source /usr/local/lib/master.cshrc
    endif
    ###############################################################################

    #
    # Put your changes/additions, here.
    #
    setenv MYSQL_UNIX_PORT /home/user/mysql.sock
    setenv MYSQL_TCP_PORT 51023
share|improve this question
2  
Post the .cshrc, or just try yourself to remove lines until the error disappears, and you have found the faulty line. –  Daniel Andersson Jun 13 '12 at 18:38
    
removed both the lines, got same result? I am doing this over Filezilla, modifying on my PC in notepad and recopying back... any issues with that? –  Greg McNulty Jun 13 '12 at 18:48
1  
Is there an empty line at the end of the file? If not, add it. –  soandos Jun 13 '12 at 19:00
1  
no, I mean just and empty line. Nothing on it. –  soandos Jun 13 '12 at 19:05
3  
@GregMcNulty: Yes, "@". You will get "pinged" for every comment here (even without my leading ping in this message) since it is your original post, but the others who have commented here will only be notified if you "ping" them. –  Daniel Andersson Jun 13 '12 at 20:15

1 Answer 1

up vote 3 down vote accepted

For reasons of C programmers not being all that robust way back when, many programs that read files will fail if the last thing in the file is not a newline.

If you place a newline at the end of your file, the issue should be fixed.

share|improve this answer
    
cron being one of those. –  ultrasawblade Jun 13 '12 at 20:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.