Created
April 22, 2024 16:22
-
-
Save hasan2001jk/51707a7c0276386df358123c914ff9c3 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 a file was provided | |
if [ -z "$1" ] | |
then | |
echo "Please provide a .deb file" | |
exit 1 | |
fi | |
# Check if file exists | |
if [ ! -f "$1" ] | |
then | |
echo "$1 does not exist." | |
exit 1 | |
fi | |
# Extract package name and dependencies | |
PACKAGE_NAME=$(dpkg-deb -f "$1" Package) | |
DEPENDENCIES=$(dpkg-deb -f "$1" Depends) | |
# Output the results | |
echo "Package Name: $PACKAGE_NAME" | |
echo "Dependencies: $DEPENDENCIES" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment