Skip to content

Interactive Shell Script #7

Description

@geneoss

Hey Libing Chen, do you have a sample script where the user is executing a shell script and user is prompted with a user prompt and user will send his choice in the xterm.js terminal.

See below shell script.

interactive.sh

#!/bin/bash
while true;
do
read -p "Do you wish to show list?" yn
case $yn in
[Yy]* ) ls -ltr; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions