Can't run Neo4j on Antergos (integer expression expected) - linux

Every time I try to run the latest version of Neo4j (2.3.2 Community) I keep getting an error that just keeps looping.
[telmo#Telmo-LT neo4j-community-2.3.2]$ bin/neo4j start
WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
bin/neo4j: line 150: [: : integer expression expected
bin/neo4j: line 153: lsof: command not found
Starting Neo4j Server...WARNING: not changing user
process [1283]... waiting for server to be ready.bin/neo4j: line 150: [: : integer expression expected
bin/neo4j: line 153: lsof: command not found
.bin/neo4j: line 150: [: : integer expression expected
bin/neo4j: line 153: lsof: command not found
.bin/neo4j: line 150: [: : integer expression expected
bin/neo4j: line 153: lsof: command not found
.bin/neo4j: line 150: [: : integer expression expected
bin/neo4j: line 153: lsof: command not found
This is a stable release and I couldn't find anyone with a similar problem.

Can you run the 'lsof' command in your shell? Looks like it is missing on your machine. It's used to define the PID of the neo4j process and failing in your case. Just have a look into the /bin/neo4j file and see what fails. I had some issues with the lsof version number which caused the IF in line 150 to fail. I ended up using a dirty hack to get it running by just hard coding the version number.

line 153: lsof: command not found, you can try install losf,I use centos system, and use this command yum install lsof -y,then try bin/neo4j start

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.

Error while using Fred's ImageMagick Scripts with Cygwin/ImageMagick Display under Windows

There are already a lot of threads about Fred's Scripts on Windows, but not quite what I was looking for.
I'm using W10 Pro with the latest Cygwin and ImageMagick Display.
So here's my problem: I followed the instructions on http://im.snibgo.com/cygwin.htm as good as I can.
Now when I start Cygwin and go to cygdrive/c/users/myname/Pictures/ and type for example:
$ textcleaner sample.png out_sample.png -g
it gives me:
Unzulässiger Parameter - configure
/cygdrive/c/Scripts/textcleaner: Zeile 400: [: : Ganzzähliger Ausdruck erwartet.
Unzulässiger Parameter - configure
/cygdrive/c/Scripts/textcleaner: Zeile 417: [: : Ganzzähliger Ausdruck erwartet.
/cygdrive/c/Scripts/textcleaner: Zeile 423: [: : Ganzzähliger Ausdruck erwartet.
Unzulässiger Parameter - sample.png
--- FILE sample.png NOT READABLE OR HAS ZERO SIZE ---
and here in English (as good as I could):
undue parameter - configure
/cygdrive/c/Scripts/textcleaner: line 400: [: : integer expression expected.
undue parameter - configure
/cygdrive/c/Scripts/textcleaner: line 417: [: : integer expression expected.
/cygdrive/c/Scripts/textcleaner: line 423: [: : integer expression expected.
undue parameter - sample.png
--- FILE sample.png NOT READABLE OR HAS ZERO SIZE ---
I really don't know anything about bash, my goal is an OCR application for Windows and i expected this script to help me get better results from 'my' engine.
Can anybody help me here? Am I missing some crucial information for you? Thanks a lot in advance!
I was facing the same errors. I found out that if you open the textcleaner.sh script and replace all occurrences of convert with magick, the script starts working in Windows.
The work done by convert is handled by magick.exe which can be found in the location where you installed ImageMagick. Make sure that you have all the relevant paths added.
Hope it helps.

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

HIVE: How can I pass a hiveconf that contains a single quote?

I would like to pass a hive arg that contains a single quote in a string. This causes the EMR Job to fail with the following error:
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
Command exiting with ret '255'
Desired Variable:
-hiveconf "myvar=Today's a great day for a test!"
Any ideas? Thanks.
try:
SET myvar="Today's a great day for a test!";
then call it:
SELECT * FROM myTable WHERE test_today=${hiveconf:myvar}
That worked for me when I tried it, but when I try:
SET myvar=Today's a great day for a test! (withoutquotes)
I get an error. Hope this helps

backspace issue on linux file

I use EditPlus to write linux bash programs. after writting when i move files to server i get these kind of errors:
sleep: invalid time interval `2\r'
Try `sleep --help' for more information.
/usr/bin/program: line 9: $'\r': command not found
/usr/bin/program: line 10: $'}\r': command not found
/usr/bin/program: line 11: $'\r': command not found
/usr/bin/program: line 12: syntax error near unexpected token `$'{\r''
'usr/bin/program: line 12: `stop() {
I have also used dos2unix to fix this issue but no success. I want to know that is there any way that I can avoid this kind of problems. it waste alot of time. is there any better editor or some way to fix this issue?
EDIT:
What I do to solve this issue is that I vi a file in linux and then copy line by line from windows file to linux file and then it works. these are lines of my code:
line7:udevadm control --reload-rules
sleep 2
echo
echo $(date +"%b %e %T") hostname Program[$$]: Program Started | tee -a /var/log/messages
echo
}
stop() {
You need to change file preferences: go to Preferences -> Files and change "Create new file as " to UNIX. Also, your might want to enable "Check invalid CR/LF, null character when loading" option.
For already produced files
cat OLDFILE | tr -d '\r' > NEWFILE
should help. You can't just redirect the output to the input:
cat FILE | tr -d '\r' > FILE
since this will truncate the input file before it is read.
In contrast to similar programs, this is not eligible for the useless-use-of-cat award, since tr doesn't accept a filename as parameter.
Setting the "line ending sequence" in VSCode / atom from CRLF TO LF and saving worked for me

Resources