If I execute any command in the linux shell, how can I save the output to a string so that the user can use it later? I need this for a bash script, please help.
str=$(command)
result=`command` or result=$(command) both assign the output of command variable result .
result=`command`
result=$(command)
command
result
Source: https://habr.com/ru/post/890291/More articles:Does javax.crypto work differently in different versions of Android OS? - javaHow to scroll iframe at the bottom of the page when loading the page? - jquerysqlite or mysql for large datasets - mysqltypedef template with all default arguments - c ++jquery ajax call - get return value if dataType is just text (string) - jqueryUsinginstead of- htmlGenetic programming in C? - cThe best way to find a similar value from a large table is sqlXcode 4: updating CFBundleVersion for each build using Git repo commit version - gitUsing NSDate in NSPredicate - iosAll Articles