473,568 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SpiderMonkey standalone commandline & stdio

1) Running a standalone script with SpiderMonkey on Linux
js -f scriptfile.js scriptarg

How can I get the value of scriptarg from within the JavaScript
scriptfile?
2) Running a standalone script with SpiderMonkey on Linux

How can I do formated printing to stdout?

(I see that /js/src/perfect.js uses print() is there an equivalent for
printing formated reals?)
3) Running a standalone script with SpiderMonkey on Linux

How can I read from stdin?
best wishes, Isaac

Jul 23 '05 #1
3 2862


Isaac Gouy wrote:
1) Running a standalone script with SpiderMonkey on Linux
js -f scriptfile.js scriptarg

How can I get the value of scriptarg from within the JavaScript
scriptfile?
I just stumbled on the first answer :-)
arguments[0] arguments[1] ...

2) Running a standalone script with SpiderMonkey on Linux

How can I do formated printing to stdout?

(I see that /js/src/perfect.js uses print() is there an equivalent for
printing formated reals?)
3) Running a standalone script with SpiderMonkey on Linux

How can I read from stdin?
best wishes, Isaac


Jul 23 '05 #2
> 2) Running a standalone script with SpiderMonkey on Linux

How can I do formated printing to stdout?

(I see that /js/src/perfect.js uses print() is there an equivalent for
printing formated reals?)


toPrecision() is almost what I was looking for

Jul 23 '05 #3
Is there a way to make a standalone SpiderMonkey JavaScript script read
from stdin?

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3318
by: brian.vincent | last post by:
I'm trying to use the ssh2 functions to run a graphical app. I have no problem opening ssh2_shell and running something like "/bin/ls /tmp". However when I try to do something like: fwrite($stdio,"/usr/X11R6/bin/xclock -display some-other-machine:0\n"); It doesn't work. I've tried wrapping the xclock command in a shell script and a C...
1
2221
by: wyl_lyf | last post by:
Hello! I know that spidermonkey can compile and detect if the javascript has any syntax errors. But I'm not sure if it can handle javascript to be ran on the server-side? example: ..response.write("<html>"...) any ideas? thanks!
5
5604
by: Robin Johnson | last post by:
Hi, I've written an engine in Javascript for running text adventure games on a web page: http://www.robinjohnson.f9.co.uk/adventure/hamlet.html (That's the only game I've written with it so far, and a version of the engine that is slightly less sophisticated than my development copy, which has cleaner code and a more authentic...
3
4858
by: Blake McBride | last post by:
Greetings, I am embedding Spidermonkey in a C app. and I'm having trouble setting class (not instance) property values. For example, I am setting up the class as follows: static JSBool constructor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) {
2
7069
by: Christoph Borger | last post by:
Hello! I have wrote a windows service in vb.net. This service monitors the running processes with WMI and the Win32_Process class. Till last month all seems ok. But since the begin of september the service can't retrieve the commandline property of the processes. I think this is an result of .NET Framework 1.1 Service Pack 1 or XP SP2. Did...
3
1852
by: pemo | last post by:
Opinion please. The code below is an attempt at demonstrating commandline arg processing. I don't really like the repetitive use of ... if(!(*s)) { // Make sure we don't go out of bounds. //
6
2631
by: Chad Crabtree | last post by:
As I'm sure some of you already know there is quite a bit of stir on Reddit about a few Javascript Rails clones. Both of them run on Rhino, which brings me to my question. Why is it that both Trimpath and the google guy choose to run on rhino vs Spidermonky. I'm coming here as it's the only place I can think of to find a cogent answer. ...
2
1813
by: zowtar | last post by:
Guys, I am using slackware... js-spidermonkey 1.5 compiled - OK, Pyrex installed, but python-spidermonkey don't build... Screenshot: http://img406.imageshack.us/img406/562/testebp5.png what is the problem? zowtar
0
7604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6275
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.