diff --git a/clite/commands.js b/clite/commands.js index f3c2975..c07417f 100644 --- a/clite/commands.js +++ b/clite/commands.js @@ -555,5 +555,89 @@ Options: return 0; }); +clite.commands.load('uname',function(args,env,io) { + var stdlib = io.include('stdlib'); + var sysname = false; + var nodename = false; + var release = false; + var version = false; + var machine = false; + + function help() { + io.write(` +uname - print system information + +Options: +-a All, equivalent to -mnrsv +-m Print the hardware info (User Agent) +-n Print the network name +-r Print the operating system release +-s Print the operating system name +-v Print the operating system version +-? Print this help information + `); + } + + for (var i=1; i ['ls','-l','var'] + uname() + returns an object containing system information: + { + sysname:'CLIte', // system name, always 'CLIte' + nodename:'localhost', // network hostname, currently always 'localhost' + release:'0.1...', // contains the current CLIte version as stored in clite.state.version + version:'0.1...', // same as release + machine:navigator.userAgent // contains the browser user agent string + } + fork(env,io,call) Creates a new process, with environment and io data passed to it. Returns the pid of the new process, or 0 on failure.