![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
github.com/chen-keinan/go-command-eval
Go-command-eval is an open source lib who evaluate shell command results against eval expr.
go get github.com/chen-keinan/go-command-eval
create shell command which return one result
shellCommands:=[]string{"ls /etc/hosts | awk -F \" \" '{print $1}' |awk 'FNR <= 1'"}
evaluate command result with eval expression ( ${0} is the result from 1st shell command)
evalExpr := "'${0}' == '/etc/hosts'"
create two shell commands with one result for each
shellCommands := []string{"ls /etc/hosts | awk -F \" \" '{print $1}' |awk 'FNR <= 1'",
"ls /etc/group | awk -F \" \" '{print $1}' |awk 'FNR <= 1'"}
evaluate each command result with eval expression
evalExpr := "'${0}' == '/etc/hosts'; && '${1}' == '/etc/group';"
create shell command with return two results
shellCommands := []string{"ls /etc | awk -F \" \" '{print $1}' |awk 'FNR <= 2'"}
evaluate command result with IN Clause eval expression
evalExpr := "'${0}' IN ('afpovertcp.cfg','aliases')"
create tow shell commands 1st command result passed as an arg to the following shell command
shellCommands := []string{"ls /etc/hosts | awk -F " " '{print $1}' |awk 'FNR <= 1'",
"stat -f %A" ${0}}
both results are evaluated against eval expression 1st result is evaluated as string 2nd result is evaluated as an Integer
evalExpr := "'${0}' == '/etc/hosts'; && ${1} <= 766"
Full code example
package main
import (
"fmt"
"github.com/chen-keinan/go-command-eval/eval"
)
func main() {
shellCommands := []string{"ls /etc/hosts | awk -F \" \" '{print $1}' |awk 'FNR <= 1'",
"ls /etc/group | awk -F \" \" '{print $1}' |awk 'FNR <= 1'"}
evalExpr := "'${0}' == '/etc/hosts'; && '${1}' == '/etc/group';"
cmdEvalResult := eval.NewEvalCmd().EvalCommand(shellCommands, evalExpr)
if cmdEvalResult.Match {
fmt.Print("commmand result match eval expression")
}
}
code contribution is welcome !! contribution with passing tests and linter is more than welcome :)
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.