Last active
August 8, 2023 03:12
-
-
Save naranyala/f7f900cac2b1c11a324f6255681448ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if the RAR file argument is provided | |
if [ -z "$1" ]; then | |
echo "Please provide the path to the RAR file as the first argument." | |
exit 1 | |
fi | |
# Verify if the RAR file exists | |
rar_file="$1" | |
if [ ! -f "$rar_file" ]; then | |
echo "File not found!" | |
exit 1 | |
fi | |
# Extract the file to the current directory | |
unrar x "$rar_file" | |
echo "Extraction complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment