What does the output of this "source" command mean?

1

1

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

Greg McNulty

Posted 2012-06-13T18:29:28.703

Reputation: 133

2Post the .cshrc, or just try yourself to remove lines until the error disappears, and you have found the faulty line. – Daniel Andersson – 2012-06-13T18:38:07.160

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 – 2012-06-13T18:48:42.697

1Is there an empty line at the end of the file? If not, add it. – soandos – 2012-06-13T19:00:54.120

@soandos: I added a space followed by a #end - same error....?did I do that right? (see updated post) – Greg McNulty – 2012-06-13T19:04:34.010

1no, I mean just and empty line. Nothing on it. – soandos – 2012-06-13T19:05:18.843

got it, that worked! please put as an answer. – Greg McNulty – 2012-06-13T19:05:57.097

Pinging @soandos (Greg, you need to actually ping people so they get a notification) – slhck – 2012-06-13T19:42:41.953

how do I ping someone? you mean '@' ? – Greg McNulty – 2012-06-13T19:52:01.537

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 – 2012-06-13T20:15:22.750

Answers

3

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.

soandos

Posted 2012-06-13T18:29:28.703

Reputation: 22 744

cron being one of those. – LawrenceC – 2012-06-13T20:24:11.737