Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.0 - Français

Change language to:
English - 日本語 - Português

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.

Manuel Scilab >> Entrées/Sorties > unix

unix

exécution d'une commande Unix ou DOS

Séquence d'appel

stat=unix(command-name)

Paramètres

command-name

chaîne de caractères contenant les commandes à exécuter

stat

un entier

Description

Envoie la chaîne command-name à l'interpréteur de commande (sh sous Unix, ou command.com sous DOS). La sortie standard et les erreurs sont reportées dans l'interpréteur de commande.

stat vaut -1 en sortie si la fonction ne peut pas être appelée (pas assez de mémoire par exemple) ou alors le code de sortie de l'interpréteur de commande.

Exemples

if getos() <> 'Windows' then
  unix("ls $SCI/demos");
end

function wd=directory()
  if getos() == 'Windows' then
    unix('cd>'+TMPDIR+'\path');
  else
    unix('pwd>'+TMPDIR+'/path');
  end
  wd=read(TMPDIR+'/path',1,1,'(a)');
endfunction

wd=directory()
<< setenv Entrées/Sorties unix_g >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jan 26 16:24:14 CET 2011