#!/bin/bash
# Prompt the user to enter a string
read -p "Enter a string: " input_string
# Extract the first character
first_character="${input_string:0:1}"
# Extract the last character
last_character="${input_string: -1}"
# Output the results
echo "First character: $first_character"
echo "Last character: $last_character"
To embed this program on your website, copy the following code and paste it into your website's HTML: