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 zip file argument is provided | |
if [ -z "$1" ]; then | |
echo "Please provide the path to the zip file as the first argument." | |
exit 1 | |
fi | |
# Verify if the zip file exists | |
zip_file="$1" |
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" |
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 | |
# Verify if the directory argument is provided | |
if [ -z "$1" ]; then | |
echo "Please provide the path to the directory you want to compress as the first argument." | |
exit 1 | |
fi | |
# Verify if the directory exists | |
directory="$1" |
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 | |
# Verify if the directory argument is provided | |
if [ -z "$1" ]; then | |
echo "Please provide the path to the directory you want to compress as the first argument." | |
exit 1 | |
fi | |
# Verify if the directory exists | |
directory="$1" |
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 7z file argument is provided | |
if [ -z "$1" ]; then | |
echo "Please provide the path to the 7z file as the first argument." | |
exit 1 | |
fi | |
# Verify if the 7z file exists | |
archive="$1" |
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 | |
# Function to print usage information | |
print_usage() { | |
echo "Usage: $0 [-O|--open] <file_path>" | |
} | |
# Check if an argument was provided | |
if [ $# -eq 0 ]; then | |
print_usage |
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 | |
# Function to print usage information | |
print_usage() { | |
echo "Usage: $0 <file_path>" | |
} | |
# Check if an argument was provided | |
if [ $# -eq 0 ]; then | |
print_usage |
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 | |
if [ $# -eq 0 ]; then | |
echo "Error: No filename provided. Usage: $0 <filename>" | |
exit 1 | |
fi | |
filename="$1" | |
if [ ! -e "$filename" ]; then |
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 | |
# Function to handle errors and exit the script | |
function handle_error { | |
echo "Error: $1" | |
exit 1 | |
} | |
# Associative array to store website URLs | |
declare -A websites |
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 | |
# Function to display metadata for a given file | |
show_metadata() { | |
if [[ -f "$1" ]]; then | |
echo "File: $1" | |
exiftool "$1" | |
echo "---------------------------------------------" | |
else | |
echo "Error: File '$1' not found or not a regular file." |