v2.0.2 Latest Version #7
iapyeh
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
SSHScript v2.0.2 Release Notes
Last Updated on 2023/10/21
Summary
SSHScript v2.0.2 reimplements its dollar-syntax functionality using the Python.ast module, making it more flexible and consistent.
Threading support has also been reimplemented, and SSHScript v2.0.2 now supports connecting to multiple hosts at the same time.
You can also now use all SSHScript functions in a regular Python script without needing to use dollar-syntax.
This makes your scripts easier to integrate with existing scripts.
Improvements
Overall, SSHScript v2.0.2 is a significant improvement over previous versions. It is more flexible, consistent, robust, and stable. It is also easier to use, thanks to the new handy functions and improved foreground process handling.
New Features
$.sudo(password)
, get a root console: The $.sudo function returns a console as the root user. This can be useful for executing commands that require root privileges. Details$.su(username,password)
, get a different user console: The $.su() function returns a console as the specified user. This can be useful for executing commands as a different user, such as sudoer account. Details$.enter(command)
, get an interactive console: The $.enter() function returns a console of an interactive process. This can be useful for executing interactive tools, such asmysql-client
. Details$.iterate(command)
, iterate over foreground command outputs: The $.iterate() function returns a loopable console for iterating over the output of a foreground command, such astcpdump`. This can be useful for processing the output of foreground commands in real time. Details$.thread(target)
, create a new SSHScript-aware thread: The $.thread() function creates a new thread that takes the session as its effective sessions. This can be useful for executing commands in a multithreaded environment. DetailsChanges
$.log()
is removed, please use$.logger
instead. The reason for this is that $.logger is more easier. For exampleAdditional Notes
$@{var}
is going to be deprecated in next release of v2.0. Please use f-string instead. For example:Simplifications in the Roadmap of SSHScript v2.0
SSHScript v2.0 will focus on improving its simplicity. The following items are on the schedule and will be implemented in next releases:
The usage case of with-dollar is now limited to invoking shell only. This means that with-dollar can no longer be used to execute commands. This is a simplification because it makes the with-dollar syntax more consistent and easier to understand.
For example:
The syntax @{var} will be removed from dollar-syntax, using $f-string is recommanded. This means that you should use Python f-strings instead of @{var} to insert variables into dollar-syntax commands. This is a simplification because f-strings are more concise and easier to use.
For example:
SSHScript v2.0 is still under development. If you find any bugs or have any suggestions, you are welcome to post them on the
issues
page.Last updated on 2023-10-21
This discussion was created from the release v2.0.2 Latest Version.
Beta Was this translation helpful? Give feedback.
All reactions