Bash
    • 10 Sep 2024
    • 1 Minute to read

    Bash


    Article summary

    Skillable Studio allows execution of scripts against a cloud subscription, as well as executing scripts that do not have a target. Scripts are used in Automated Activities and Life Cycle Actions.

    Interacting with Skillable Studio

    Your scripts can communicate success or failure to Skillable Studio in one of two ways.

    Return a Boolean value

    //do stuff... all good
    echo true
    
    //do stuff... uh oh
    echo false
    

    Use setActivityResult

    //do stuff... all good
    set_activity_result Correct
    
    //do stuff... uh oh
    set_activity_result Incorrect
    

    You can also report the result as a score percentage...

    //do stuff... we want to report success and set the score value as 50%
    set_activity_result .5
    

    Send a Notification to the User

    Notifications appear as real-time toast notification in the lab client.

    send_lab_notification "Hello from a script"
    

    Lab Variables

    Lab variables are always string name/value pairs. Variable values are scoped to the lab instances and become available within the lab instructions as well as subsequent script executions.

    variable_name=value

    set_lab_variable "firstName" "John"
    echo true
    

    You can "receive" a variable in your script...
    @lab.Variable(firstName)


    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.