after install ns2: syntax error near unexpected token 'You' - linux

after install ns2 i meet this problem
IMPORTANT: command not found
bash: /home/tuanhoang/.bashrc: line 144: syntax error near unexpected token You'
bash: /home/tuanhoang/.bashrc: line 144:(1) You MUST put /home/tuanhoang/ns-allinone-2.35/otcl-1.14, /home/tuanhoang/ns-allinone-2.35/lib,
syntax error near unexpected token 'You'
I am using ubuntu 16.04. How can i solve this problem ? Thank all of you guys for your responds

This looks like some program has put a comment in your ~/.bashrc file without properly prefixing each line with #.
Read the comment in the file and follow its instruction. Then either remove it or comment it out properly by prefixing it with #.

Related

(./runalg: line 25: syntax error near unexpected token 'set' )in Middle bury evaluation

I am testing stereo algorithm in MiddleBury evaluation. I am using cygwin in Windows to run the program.
After compiling tools, I have run the code. According to the guide, I need to write as follows"
./runalg
But it says:
$ ./runalg
-bash: ./runalg: /bin/csh: bad interpreter: No such file or directory
So, I have changed like
bash ./runalg.
In this case, the error was as follows.
$ bash ./runalg
./runalg: line 25: syntax error near unexpected token `set'
./runalg: line 25: `if ($#argv > 3) set suffix = $4'**
Is there anyone, who can advice me how to use this evaluation and why this problem was occurred?
csh and bash/ksh-type shells have a totally different syntax. Except for very simple commands, you won't be able to get compatibility just by changing the interpreter.
If you had bash script and ksh interpreter, a few adaptations could make the script work in most cases but here no way!
ex in csh:
set suffix = $4
would translate to
suffix=$4
(or maybe export suffix=$4 I don't know the exact variables propagations in csh but that's not the point)
The best way is to actually install csh in Cygwin.
According to this forum, the C Shell is not installed by default in Cygwin. Startup the Setup program and select the "Shells" collection of packages and select csh for installation.

Bash: Syntax Error Near Unexpected Token `(' When Using Wgrib2

Good Evening All,
I'm currently having a bash syntax issue when I try to run the following command in my terminal, the
bash: syntax error near unexpected token `('
error message pops up after I run the below code:
/mnt/grads/bin/wgrib2 /home/aaron/grads/data/sref_prob/20140530/15Z/sref.20140530.t15z.prob.grib2
-match ^(255|371|487|623|759|895|1031|1187|1343|1499|1655|1811|1967|2123|2279|2435|2591|2747|2903|3059|3215|3371|3527|3683|3839|3995|4151|4307):
-grib /home/aaron/grads/data/sref_prob/20140530/15Z/test.grib2
I realize that not many people on here probably have experience using wgrib2 but, this seems like a syntax error, not an issue with the program...
Parentheses and pipes have special meaning to the shell, you need to quote or escape them:
/mnt/grads/bin/wgrib2 /home/aaron/grads/data/sref_prob/20140530/15Z/sref.20140530.t15z.prob.grib2 \
-match '^(255|371|487|623|759|895|1031|1187|1343|1499|1655|1811|1967|2123|2279|2435|2591|2747|2903|3059|3215|3371|3527|3683|3839|3995|4151|4307):' \
-grib /home/aaron/grads/data/sref_prob/20140530/15Z/test.grib2

bashscript Heredoc + FTP error

I try to do this
#!/bin/bash
ftp "$HOST"$3"/"$2"/" <<EOD
#toggle Interactive mode
prompt off
lcd $5"/"$4
mget "$4"*
exit
EOD
I get the following error
syntax error: unexpected end of file
When I changed it to or any other possibility
ftp "$HOST"$3"/"$2"/" <<<EOD
#toggle Interactive mode
prompt off
lcd $5"/"$4
mget "$4"*
exit
EOD
I get
./download.sh: line 31: 87621 Segmentation fault: 11 ftp "$HOST"$3"/"$2"/" <<< EOD
./download.sh: line 20: prompt: command not found
./download.sh: line 21: lcd: command not found
./download.sh: line 22: mget: command not found
I am not sure how to fix this. What am I supposed to doooo O_O
On my Mac, the segmentation faults were produced by the comments in the script. Removing the lines with the trailing # would make it work.
many interactive commands don't really deal well with piped input. maybe try http://www.columbia.edu/kermit/ftpscripts.html ?
that said, many others seem to have had success doing what you're doing (e.g. http://www.unix.com/unix-advanced-expert-users/4189-automated-ftp.html ), so maybe you just have a quoting problem? try changing the command (ftp "$HOST"$3"/"$2"/") to just cat to see if the shell is properly passing there here-doc to it?
this, too, may lend insight if you end up needing to supply a password: http://www.stratigery.com/scripting.ftp.html

Trying to regenerate zend_language_scanner.c

I'm trying to add a new keyword in PHP (just learning the core), so what I did was: added a new token to zend_language_parser.y, used it in an unticket_statement, compiled PHP, but it didn't work out. It seems like I need to add that new keyword in zend_language_scanner.l (I assumed it by another definitions in this file) and regenerate zend_language_scanner.c with the help of re2c.
But here's what re2c gave me:
$ re2c -isgf Zend/zend_language_scanner.l
re2c: error: line 1004, column 6: can't find symbol
Line 1004 contains this definition:
LNUM [0-9]+
This error will pop even on unchanged zend_language_scanner.l file.
Here's re2c -v output: re2c 0.13.5
Does anybody knows how can I regenerate this scanner or what am I doing wrong?
you should try it like this:
re2c --no-generation-date --case-inverted -cbdF -o a.c zend_language_scanner.l
I have the same problem, until i found the source cmd from file Makefile.frag:
$(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c Zend/ zend_language_scanner.l)

Linux bat file command line arguments:unexpected EOF while looking for matching `"'

i am running a bat file in linux as following .
java -cp ../lib/qautils.jar:../lib/Log4jWrapper1.2.jar:../lib/log4j-1.2.15.jar:../lib/jaa.jar com.pcube.qa.jaa.server.JAAServer -appdir /home/alpha/jaa/bin"
but if i run above getting following error:
./runjaa.bat: line 1: unexpected EOF while looking for matching `"'
./runjaa.bat: line 2: syntax error: unexpected end of file
Will anyone suggest me , where i am doing mistake.
If i delete " at the end , saying the directiory ,/home/alpha/jaa/bin does not exists.
Assuming that what you posted is accurate, you have a trailing " on that line that doesn't match up with another quotation mark. A quotation mark opens a quoted string, so your shell is looking for the closing quote.
You don't need the quote in this example, so just remove it.

Resources