Skip to content

Commit 5a73574

Browse files
committed
# ✅ How to Run OpenLinks.sh on macOS
This guide helps you run the `OpenLinks.sh` script that opens Java documentation links from the terminal. --- ## 📁 1. Navigate to the Script Folder Open Terminal and go to the folder where the script is saved: ```bash cd "/Users/somesh/Java SE/JavaEvolution-Learning-Growing-Mastering/Section6StringClassPrinting" ``` > ✅ Tip: You can also drag the folder into the Terminal to auto-fill the path. --- ## 🔐 2. Give Execute Permission (One-Time Setup) Run this command to make the script executable: ```bash chmod +x OpenLinks.sh ``` --- ## ▶️ 3. Run the Script Now run the script with: ```bash ./OpenLinks.sh ``` You’ll see a menu with options to open the Java documentation in your browser. --- ## 📌 Notes - Use number keys (1 or 2) to make a selection. - The `open` command automatically launches your macOS default web browser. Signed-off-by: Somesh diwan <[email protected]>
1 parent 7e753be commit 5a73574

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
# Navigate to the directory of the script
3+
cd "$(dirname "$0")"
4+
5+
while true; do
6+
clear
7+
echo "====================================================="
8+
echo " Java Tutorial - Operators Q&A Answer Page"
9+
echo "====================================================="
10+
echo "1. Open Oracle Operators Answer Page"
11+
echo "2. Exit"
12+
echo
13+
read -p "Enter your choice [1-2]: " choice
14+
15+
case "$choice" in
16+
1)
17+
open "https://docs.oracle.com/javase/tutorial/java/nutsandbolts/QandE/answers_operators.html"
18+
;;
19+
2)
20+
echo "Goodbye!"
21+
break
22+
;;
23+
*)
24+
echo
25+
echo "Invalid choice. Please select 1 or 2."
26+
read -p "Press Enter to continue..."
27+
;;
28+
esac
29+
done

0 commit comments

Comments
 (0)