Ruby
oscommand.rb
current = "test"
system("ls")
system("mkdir" ,"./#{current}")
#system("rm" , "-r", "./#{current}")
> ruby oscommand.ruby
Python
oscommand.py
import 'os'
os.system("ls")
os.system("mkdir ./test")
#os.system("rm -r ./test")
> python oscommand.py
golang
oscommand.go
package main
import (
"log"
"os/exec"
)
func main(){
title := "test"
cmd := exec.Command("zip","-4", title + ".zip","-r","./" + title)
err := cmd.Run()
if err != nil {
log.Fatal(err)
}
cmd = nil
cmd = exec.Command("rm","-r","./" + title)
err = cmd.Run()
if err != nil {
log.Fatal(err)
}
cmd = nil
}
> go run oscommand.go
Nim
oscommand.nim
import os
discard execShellCmd("ls")
discard execShellCmd("echo")
discard execShellCmd("mkdir ./test")
discard execShellCmd("echo")
discard execShellCmd("ls")
discard execShellCmd("rm -r ./test")
discard execShellCmd("echo")
discard execShellCmd("ls")
> nim c -r oscommand.nim