[SOLVED] source bashrc -> syntax error: unexpected end of file
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Just checked out; the "if" command can be overruled by an alias. In order of execution (correct me if I'm wrong) comes:
- alias
- shell functions
- binaries in order as they appear in the path, unless a direct full pathname is given.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
Aliasing if certainly causes lots of syntax errors but doesn't seem to cause EOF errors, have you tried just moving the files aside and recreating them from scratch?
Sorry for the delay to answer to the last posts (this is getting very interesting/educational for me). I've been spending Christmas time with the family, away from my box.
I will use your latest suggestions on my rig today, and I'll post again.
After which, source .bashrc keeps producing the same error message.
2)
Quote:
typeset -F
Does not show anything coinciding with the if statements
3)
Quote:
alias | grep if
does not return any hit. HOWEVER...
Quote:
alias | grep fi
produces alias fi='find . -iname', which coincides with the fi part of the last line of the if statement.
I replaced that line and everything returned to normal.
In short, brilliant and timely suggestions led me to a solution of this. They also led me to read some necessary material to better understand the problem. For all this I'm grateful to you guys.
Great that you solved it at last but I do not understand why unalias -a did not fix the problem if it was caused by a fi alias -- unless the fi alias was defined by the $PROMPT_COMMAND value ... ?
:-) great you got it solved! Now: remember to never ever use any shell keyword as an alias :-D Unless you intentionally want to break it's functionality.
Should've thought that one up: indeed "if" would not cause the unexpected EOF, but an if that never gets closed would... hence "fi" was indeed ever the most logical reason.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.