Re: bashrc configuration question: syntax error: unexpected end of file
Hi, Christopher Cowart wrote: Noah wrote: I am unable to figure out why I am getting the following error: "-bash: /Users/user/.bashrc: line 10: syntax error: unexpected end of file [...] localhost:~ user$ cat .bashrc #nc_fix() { sudo kill -9 $"(ps auxwww | grep [nN]cproxyd | awk '{print $2}')" } nc_fix() { sudo kill -9 $(ps auxwww | grep "[nN]cproxyd" | awk '{print $2}') } The } is a statement, and must be preceded with a newline or a ;. Try: nc_fix() { sudo kill -9 $(ps auxwww | grep "[nN]cproxyd" | awk '{print $2}'); } or nc_fix() { sudo kill -9 $(ps auxwww | grep "[nN]cproxyd" | awk '{print $2}') } Everything that follows right now is part of the definition of nc_fix(). When you get to the end of the file, it says "Hey! I'm still defining a function!" Christopher - you are the winner. Please pick up your consolation prize at the door :) Cheers, noah ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: bashrc configuration question: syntax error: unexpected end of file
Hi there, Christopher Cowart wrote: A couple more things I noticed after looking more closely at your actual command: Christopher Cowart wrote: nc_fix() { sudo kill -9 $(ps auxwww | grep "[nN]cproxyd" | awk '{print $2}') ^ this is equivalent to: $(ps auxwww | awk '/[nN]cproxyd/ {print $2}') } You might also want to check out pkill(1): $ sudo pkill -9 '[nN]cproxyd' And as an alias: $ alias nc_fix="sudo pkill -9 '[nN]cproxyd'" okay cool, arent there two ways to get nc_fix defined in the .bashrc option 1: like as a function: nc_fix() { sudo kill -9 $(ps auxwww | awk '/[nN]cproxyd/ {print $2}') } option 2: as an alias: alias nc_fix="sudo pkill -9 '[nN]cproxyd'" right, Noah ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: bashrc configuration question: syntax error: unexpected end of file
Noah wrote: > I am unable to figure out why I am getting the following error: "-bash: > /Users/user/.bashrc: line 10: syntax error: unexpected end of file [...] > localhost:~ user$ cat .bashrc > #nc_fix() { sudo kill -9 $"(ps auxwww | grep [nN]cproxyd | awk '{print > $2}')" } > nc_fix() { sudo kill -9 $(ps auxwww | grep "[nN]cproxyd" | awk '{print > $2}') } The } is a statement, and must be preceded with a newline or a ;. Try: nc_fix() { sudo kill -9 $(ps auxwww | grep "[nN]cproxyd" | awk '{print $2}'); } or nc_fix() { sudo kill -9 $(ps auxwww | grep "[nN]cproxyd" | awk '{print $2}') } Everything that follows right now is part of the definition of nc_fix(). When you get to the end of the file, it says "Hey! I'm still defining a function!" -- Chris Cowart Network Technical Lead Network & Infrastructure Services, RSSP-IT UC Berkeley pgp8Ud6NqCehN.pgp Description: PGP signature
Re: bashrc configuration question: syntax error: unexpected end of file
On Tue, 09 Dec 2008 13:28:11 -0800 Noah <[EMAIL PROTECTED]> wrote: >Hi there, > >I am unable to figure out why I am getting the following error: >"-bash: /Users/user/.bashrc: line 10: syntax error: unexpected end of >file localhost:~ user$" > > > Here are the relevant hask configuration files -- > >localhost:~ user$ cat .bash_profile >if [ -f ~/.bashrc ]; then > source ~/.bashrc >fi >localhost:~ user$ cat .bashrc >#nc_fix() { sudo kill -9 $"(ps auxwww | grep [nN]cproxyd | awk '{print >$2}')" } >nc_fix() { sudo kill -9 $(ps auxwww | grep "[nN]cproxyd" | awk '{print >$2}') } > ># enable programmable completion features (you don't need to enable ># this, if it's already enabled in /etc/bash.bashrc and /etc/profile ># sources /etc/bash.bashrc). >if [ -f /etc/bash_completion ]; then > . /etc/bash_completion >fi >localhost:~ user$ > > > >--- snip --- I once had a similar problem; however the line number given had nothing to do with where the actual error was. In my case, I had a duplicate ';' I believe located in the file. You will probably have to go through the file line by line to locate the problem. Perhaps commenting out sections and seeing if the problem continues might help. -- Jerry [EMAIL PROTECTED] It destroys one's nerves to be amiable every day to the same human being. -- Benjamin Disraeli signature.asc Description: PGP signature
Re: bashrc configuration question: syntax error: unexpected end of file
On Tue, 09 Dec 2008 13:28:11 -0800, Noah <[EMAIL PROTECTED]> wrote: > Hi there, > > I am unable to figure out why I am getting the following error: "-bash: > /Users/user/.bashrc: line 10: syntax error: unexpected end of file > localhost:~ user$" The only thing that comes into my mind is this line from your .bash_profile: > source ~/.bashrc I'm not sure, but according to the builtin manpage, sh does not understand "source", so maybe bash doesn't, too? For file inclusion, "." is the correct form as it occurs in your .bashrc file. By the way, it would be good if you would include line numbers, using "cat -n ". :-) -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"