Comments (10)
@charlespwd I just pushed a fix for using flk
in the hash-bang. To test this:
- Have
flk
on your path. - Have a script with
#!/usr/bin/env flk
as the first line. - Make it executable.
Then call your Fleck script and it should execute correctly.
Please let me know if you get a chance to test it so we can close this one.
from flk.
Works! Awesome!
from flk.
Ah it looks like that's not possible because of shebang nesting.
Most operating systems do not allow a shell script to be the interpreter in a shebang for security reasons. – chepner Nov 14 '15 at 15:33
from flk.
Ah that's a bummer. What about if there was a small compiler script which would take your script + the fleck source and compile them together into a new file? Shouldn't be hard to whip up.
from flk.
I just whipped this up:
$ cat wow.clj
(println "WOW")
$ make DEST=wow INSERT=./wow.clj
cat mal/bash/mal | sed '/then exit/,$d' > wow
cat src/extras.sh >> wow
echo 'read -d "" _REPCAPTURE <<INLINEMALFILE' >> wow
cat mal/lib/alias-hacks.mal mal/lib/pprint.mal >> wow
[ "./wow.clj" = "" ] || cat ./wow.clj >> wow
echo 'INLINEMALFILE\nREP "(do ${_REPCAPTURE})";\n' >> wow
cat src/file-repl.sh >> wow
chmod 755 wow
$ ./wow
WOW
Fleck
user>
Would that work for you as a temporary solution?
from flk.
Docs here: https://github.com/chr15m/flk#compile
from flk.
@charlespwd since the fix for #3 I now see the following when I do this:
$ ./shebangtest
Error: "'#!/usr/bin/env' not found"
So maybe this is what was happening to you above but the error was getting swallowed?
This error is flk itself getting confused by the shebang and is something we could/should fix.
There seems to be some inconsistency with regards to nested shebangs - can I ask what OS you are on?
from flk.
Sure, I'm on arch linux 5.3.13-arch1-1.
Would we have a #!/usr/bin/env
in the middle of the file if we merge them like you said eariler? Especially since lisp/clojure doesn't use #
as a comment.
Could simply write the script without the leading shebang though
from flk.
That #!/usr/bin/env
already happens because of the way mal compiles the scripts together but it's not a problem. I think the fix for this is to get fleck to special-case parsing the first line of the file if it's a shebang and ignore it. Will investigate further.
from flk.
@charlespwd thank you very much for testing.
from flk.
Related Issues (20)
- Makefile rule to create a sourceable version so that internals can be re-used. HOT 5
- Add tests for Fleck specific functions, re-using mal's test infrastructure.
- A way to get the return code from an sh* function interop call HOT 8
- How do I get CLI args? HOT 1
- stdin doesnt read to EOF. only till end of first form HOT 2
- Piping examples/ip-addresses.clj into flk hangs
- Keyword as a function seems broken HOT 1
- Are you using Fleck? I would love to hear about it. HOT 1
- str-pos should return the position of string a in string b
- quasiquote symbol "`" break when it is merged in __FLECK__REPCAPTURE
- Help request serialize HOT 3
- What is the license? HOT 6
- env does not work on mac os HOT 15
- doc should say flk requires bash 4 or greater HOT 2
- range should be better supported HOT 1
- Carriage returns from sh* are incorrectly escaped HOT 1
- Makefile compilation mode failing [needs more info] HOT 13
- Some suggestions HOT 2
- Which versions of bash does this support? HOT 3
- Create and maintain a GitHub release instead of versioning the output file. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flk.