Skip to content

Instantly share code, notes, and snippets.

@naranyala
Last active August 8, 2023 03:12
Show Gist options
  • Save naranyala/f7f900cac2b1c11a324f6255681448ea to your computer and use it in GitHub Desktop.
Save naranyala/f7f900cac2b1c11a324f6255681448ea to your computer and use it in GitHub Desktop.
#!/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