Not able to run Red language script on Linux - linux

I am trying to run following simple script file:
#! /usr/local/bin/red-063
Red []
print "testing"
quit
But I am getting following error:
** Script Error: Invalid compressed data - problem: -3
** Near: script: decapsulate
if none? script
This error is mentioned on this page: https://github.com/red/red/blob/master/environment/system.red but details are not clear and also how it can be corrected.
Similar script for Rebol 2.7.8 works. Where is the problem?

The problem is with rebol not being able to unpack. See here.
Essentially create a batch file or shell script in the directory as the red binary to invoke the red binary.

Related

POSIX Shell Script throws syntax error with ./configure

I'm about done working out the dependencies for compiling a program on my linux box. I'm running Linux Mint 19 64bit. The last hurdle I can't seem to get over is a syntax error about a specific line in the configure shell script. Exact error is:
./configure: line 1804: syntax error near unexpected token [foreign]'
./configure: line 1804:AM_INIT_AUTOMAKE([foreign])'
The sister file configure.ac has a reference to AM_INIT_AUTOMAKE([foreign]), and if I remove the offending token of [foreign] many other errors come up. So the token in some way seems necessary.
The furthest I have been able to get is leaving the contents of the parentheses empty with a single whitespace character, so it would read: AM_INIT_AUTOMAKE( ). This satisfies the errors but moves the syntax error down a line to: ac_ext=c.
Here is the offending section of code.
AM_INIT_AUTOMAKE([foreign])
ac_ext=c
This is only two lines in a 2000+ line file.
The shell environment is #! /bin/sh
I've tried changing the environment to bash for the sake of being thorough, but it doesn't make a difference.
What am I doing wrong?
The d0_blind_id package (https://gitlab.com/xonotic/d0_blind_id) contains a script called autogen.sh. Run this script (which calls autoreconf -i) to create configure. Run configure and then make.
The configure script should not contain AM_INIT_AUTOMAKE that is part of configure.ac which is used by autotools to generate the configure script.
When I follow these steps I do not get any errors when running the configure script and it does not contain AM_INIT_AUTOMAKE.
I do not know reason you are getting an error as I can not duplicate the issue.

Cannot run julia file - syntax error close to the unexpected token

Well, i wrote a simple "hello world" in julia, but i cannot figure out on how to run the code. I've tried to run by ./nameOfMyFile.jl and the terminal returned to me that I have syntax errors.
My code is just:
println("hello world")
Wich works perfectly if i run julia on the terminal and write the code after that...
The error is something like( I am translating it from portuguese):
./hello_world.jl: line 1:syntax error close to the unexpected token `"hello world"
./hello_world.jl: line 1: `println("hello world")'
I'm using vim, debian 8 and julia 0.3.2
If you want to execute it directly from the terminal you can add a shebang to the beggining of your script i.e.
#!/usr/bin/env julia
println("hello world")
and then make it executable using chmod
[user#computer]$ chmod +x hello
then it should run as expected :)
./hello
will print "hello world" to your terminal :)
Two ways I can think of to achieve what you want
Open a terminal and do either one of the following
Inside the julia relp, that is, if you run julia in the terminal by running
julia
and when you're in, do
include("nameoffile.jl")
if you simple want to run the file, in the terminal do
julia nameoffile.jl
Based on discussions on GitHub like this one it sounds like this issue is more due to the shell than to Julia. Nevertheless, I would strongly recommend upgrading to the latest version of Julia, 0.4.6. The version that you are using is quite old and lacks a lot of improvements, including ones addressing issues at least similar to what you are experiencing.

syntax error near unexpected token while executing a python file

I was trying to execute a python file which is not saved in the python directory but in a different one in linux (fedora) terminal. What I tried was:
$ exec(vsh1.py)
which resulted an error:
bash: syntax error near unexpected token 'vsh1.py'
Could anybody find a solution please...
Thanks in advance
Locate your python's source file
find / -name vsh1.py
and once located run
python /path_you_found/vsh1.py
if you want your script to be seen from any location for the interpreter you have to add it to PYTHONPATH:
PYTHONPATH=$PYTHONPATH:/path_you_found/vsh1.py
if your script in the same directory you can just run
python ./vsh1.py
exec(python2.7 filename.py) This will be the command.
You want this:
python vsh1.py
Or if you have your script set up properly with executable permissions and a "shebang line":
./vsh1.py

Sublime Text 3 and Python 3 - exception messages

I've just switched to Sublime Text 3 (from ST 2 actually) and I am getting this annoying error message when executing an invalid code. Say, I run this code (which is of course invalid in Python 3):
print 'this'
I am getting this extended error message from my Sublime:
SyntaxError: invalid syntax
[Finished in 0.2s with exit code 1]
[shell_cmd: python -u "C:\Users\Myname\Desktop\working.py"]
[dir: C:\Users\Myname\Desktop]....CUT HERE...
So alongside the exception Sublime is printing all the environment variable paths that I have. I am guessing this is abnormal behavior? or do you get this kind of error messages as well on Sublime Text 3?
If this is of any relevance, I have both Python27 and Python 33 installed, although only Python33 is put into variable paths.
Install the Better Build System package. Add these settings to your user preferences (Preferences -> Settings - User):
"show_panel_on_failed_build_only": false,
"show_debug_text": false,
"show_panel_on_build": true
Took me too long to notice you aren't talking about Sublime's plug-in interface (that uses an embedded copy of Python 3), but about the "Build" command that just runs the file in the Python interpreter found in the PATH.
To answer your question- yes, I get this kind of messages whenever I run some code in Python that exits with non-0 exit code. Could just be:
import sys
sys.exit(1)
Change this to exit(0) and the output is just:
[Finished in 0.0s]
So looks just it's just Sublime's build tool trying to be helpful.
According this documentation, https://docs.python.org/3.0/whatsnew/3.0.html#print-is-a-function you need to include parenthesis like this print ('this')

Issue with running Bash script in linux.

Im having an issue with a bash script i picked up from google code. I have all the dependencies installed and i have it setup to what i think is correct.
To run the code im typing into the console ./jasagerPwn.sh
The error its saying is
[!] FATAL: You must run jasagerPwn from inside the directory...
....WHAT DIRECTORY? I dont know what directory it expects me to run it from?
You can see the script i am using here: http://jasagerpwn.googlecode.com/svn/trunk/jasagerPwn
When you run the script, it looks in the current dir if you have something matching jasagerPwn. If not, the error you was encountering appears.

Resources