Ok, i do this
change my script to this simple one
#!/bin/bash
ls
so now i have a "a.sh" script in my Desktop , then i run Firefox from
terminal (to see output)
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("/home/joe/Desktop/a.sh");
var process = Components.classes["@mozilla.org/process/util;1"]
.createInstance(Components.interfaces.nsIProcess);
process.init(file);
var args = [];
process.run(false, args, 0);
code does not return error nor list of files ! ; terminal does not show any
things too !
On Jan 27, 2008 5:50 PM, Jesper Staun Hansen <[EMAIL PROTECTED]> wrote:
> Failed to see you mentioned that it must create a file if it doesn't
> exist.
> You could first check if the file exists and then create it if not.
> But how does this tie all together with you wanting to run a script? No
> idea in running a scripted file if it doesnt exist or is empty.
>
> joe ertaba wrote:
> > my script must create a file (when i dbclick on it, it creates a file
> > but by (1) no file creates) so I am sure that first code also does not
> > works !
> >
> > On Jan 27, 2008 5:41 PM, Jesper Staun Hansen <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> > You would need to start firefox in a terminal to see the output from
> > a.sh for 1.
> > Dont know about 2.
> >
> > joe ertaba wrote:
> > > Ok, let me aks a simple question first
> > >
> > > I have a script: a.sh
> > >
> > > how to run it in Linux ! ///My script works when i dbclick on it
> !/
> > >
> > > 1.
> > > var file = Components.classes["@mozilla.org/file/local;1
> > <http://mozilla.org/file/local;1>
> > > <http://mozilla.org/file/local;1>"]
> > >
> > .createInstance(Components.interfaces.nsILocalFile);
> > > file.initWithPath("/home/joe/Desktop/a.sh");
> > >
> > > var process = Components.classes["@mozilla.org/process/util;1
> > <http://mozilla.org/process/util;1>
> > > <http://mozilla.org/process/util;1>"]
> > >
> > .createInstance(Components.interfaces.nsIProcess);
> > > process.init(file);
> > > var args = [];
> > > process.run(false, args, 0);
> > > 2.
> > > var file = Components.classes["@mozilla.org/file/local;1
> > <http://mozilla.org/file/local;1>
> > > <http://mozilla.org/file/local;1>"]
> > > .createInstance(Components.interfaces.nsILocalFile);
> > > file.initWithPath("/home/joe/Desktop/a.sh");
> > > file.launch();
> > >
> > > the first code doesn't return error but does not execute script
> > too !
> > > the second code return this error :Component returned failure
> code:
> > > 0x80004005 (NS_ERROR_FAILURE)
> > >
> > >
> > >
> > >
> > > On Jan 27, 2008 5:21 PM, Jesper Staun Hansen <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>
> > > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
> > >
> > > 1. Do you want a terminal to open up and list the files?
> > > 2. Or do you want firefox to return the list of files?
> > >
> > > 1. Dont go there.
> > > 2. Go here
> > >
> > > why? Because there are so many different terminals.
> > >
> > > joe ertaba wrote:
> > > >
> > > > $ which ls
> > > > /bin/ls
> > > >
> > > > it works ?! why terminal not opens and shows list of files ?
> > > >
> > > >
> > > >
> > > >
> > > > >
> > > > >
> > > > > --
> > > > > MARCELO DE FREITAS ANDRADE
> > > > > | Computer Science Bachelor
> > > > > | Web Application Dev Specialist
> > > > > | Linux Certified Professional LPIC-1
> > > > > _______________________________________________
> > > > > Project_owners mailing list
> > > > > [email protected]
> > <mailto:[email protected]>
> > > <mailto:[email protected]
> > <mailto:[email protected]>>
> > > <mailto:[email protected]
> > <mailto:[email protected]>
> > <mailto:[email protected] <mailto:[email protected]
> >>>
> > > > <mailto:[email protected]
> > <mailto:[email protected]>
> > > <mailto:[email protected]
> > <mailto:[email protected]>>
> > > <mailto:[email protected]
> > <mailto:[email protected]>
> > <mailto:[email protected]
> > <mailto:[email protected]>>>>
> > > > >
> > https://www.mozdev.org/mailman/listinfo/project_owners
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> ------------------------------------------------------------------------
> > > > >
> > > > > _______________________________________________
> > > > > Project_owners mailing list
> > > > > [email protected]
> > <mailto:[email protected]>
> > > <mailto:[email protected]
> > <mailto:[email protected]>>
> > > <mailto:[email protected]
> > <mailto:[email protected]>
> > <mailto:[email protected] <mailto:[email protected]
> >>>
> > > > > https://www.mozdev.org/mailman/listinfo/project_owners
> > > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > Project_owners mailing list
> > > > [email protected]
> > <mailto:[email protected]>
> > <mailto:[email protected] <mailto:[email protected]
> >>
> > > <mailto:[email protected]
> > <mailto:[email protected]>
> > <mailto:[email protected] <mailto:[email protected]
> >>>
> > > > https://www.mozdev.org/mailman/listinfo/project_owners
> > > >
> > > >
> > > >
> > >
> >
> ------------------------------------------------------------------------
> > > >
> > > > _______________________________________________
> > > > Project_owners mailing list
> > > > [email protected]
> > <mailto:[email protected]>
> > <mailto:[email protected] <mailto:[email protected]
> >>
> > > > https://www.mozdev.org/mailman/listinfo/project_owners
> > > >
> > >
> > >
> > > _______________________________________________
> > > Project_owners mailing list
> > > [email protected] <mailto:[email protected]>
> > <mailto:[email protected] <mailto:[email protected]
> >>
> > > https://www.mozdev.org/mailman/listinfo/project_owners
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > Project_owners mailing list
> > > [email protected] <mailto:[email protected]>
> > > https://www.mozdev.org/mailman/listinfo/project_owners
> > >
> >
> >
> > _______________________________________________
> > Project_owners mailing list
> > [email protected] <mailto:[email protected]>
> > https://www.mozdev.org/mailman/listinfo/project_owners
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Project_owners mailing list
> > [email protected]
> > https://www.mozdev.org/mailman/listinfo/project_owners
> >
>
>
> _______________________________________________
> Project_owners mailing list
> [email protected]
> https://www.mozdev.org/mailman/listinfo/project_owners
>
_______________________________________________
Project_owners mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/project_owners