-
-
Save zewebdev1337/b042fde3ce2eb4637d0601de159c33c3 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 filename is provided | |
| if [ -z "$1" ]; then | |
| echo "Usage: $0 <filename>" | |
| exit 1 | |
| fi | |
| # Use the provided filename | |
| filename="$1" | |
| # Check if the file exists | |
| if [ ! -f "$filename" ]; then | |
| echo "File not found: $filename" | |
| exit 1 | |
| fi | |
| # Copy the content of the file to the clipboard | |
| cat "$filename" | xclip -selection clipboard | |
| echo "Content of $filename copied to clipboard." | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment