Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.java > #9318

Re: comandi Bash su Mac da Java

Path csiph.com!aioe.org!.POSTED.D/yWLgg4/J3ZIv1oe1tc3Q.user.gioia.aioe.org!not-for-mail
From "Dr.UgoGagliardelli" <do.not.spam@me.please>
Newsgroups it.comp.java
Subject Re: comandi Bash su Mac da Java
Date Fri, 30 Aug 2019 16:43:21 +0200
Organization Aioe.org NNTP Server
Lines 23
Message-ID <qkbcok$fgt$1@gioia.aioe.org> (permalink)
References <qkasei$4c9$3@gioia.aioe.org>
NNTP-Posting-Host D/yWLgg4/J3ZIv1oe1tc3Q.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-15; format=flowed
Content-Transfer-Encoding 8bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0
X-Antivirus-Status Clean
X-Notice Filtered by postfilter v. 0.9.2
Content-Language it-IT
X-Antivirus Avast (VPS 190830-2, 30/08/2019), Outbound message
Xref csiph.com it.comp.java:9318

Show key headers only | View raw


Il 30.08.2019 12.06, dennis ha scritto:
> Buongiorno a tutti, non riesco a far eseguire un comando di shell (Bash, 
> su Mac OS) da un programma Java.
> 
> Ho bisogno di salvare l'output del comando ls su un file di testo. Il 
> file compilato del programma si trova nella stessa cartella che contiene 
> anche la cartella con i files il cui elenco voglio visualizzare in ls.
> 
> questa รจ la parte di codice:
> 
> String comando = "/bin/bash -c \"ls CartellePratiche > 
> ElencoPratiche.txt\"";

In genere utilizzo il metodo
exec(String[] cmdarray, String[] envp, File dir)

dove cmdarray sarebbe:

String[] cmdarray = {"/bin/bash", "-c", "\"ls CartellePratiche >
 > ElencoPratiche.txt\""};

e envp e dir possono essere null.

Back to it.comp.java | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

comandi Bash su Mac da Java dennis <dennispavesi@outlook.it> - 2019-08-30 12:06 +0200
  Re: comandi Bash su Mac da Java Enrico Bianchi <enrico.bianchi@ymail.com> - 2019-08-30 13:32 +0000
  Re: comandi Bash su Mac da Java "Dr.UgoGagliardelli" <do.not.spam@me.please> - 2019-08-30 16:43 +0200
  Re: comandi Bash su Mac da Java Gioacchino <vannnnia1991@gmail.com> - 2019-08-30 18:33 +0200

csiph-web