Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I found this interesting Bash-Snippets from Github. I downloaded it with the [code] button and extracted it manually. The "meme" bash outputs a jpg which is, corrupt and can't be viewed therefore. I checked the code but still can't pinpoint the reason, why it isn't working. I tried multiple PhotoViewer tools. For usage, i tried
Code:
$ ./meme -f test #outputs the filename as "test.jpg"
$ doge #background
$ Topline #toplineText
$ Bottomline #BottomlineText
The other bashes, which i can profit from, are all functional, out of the box.
Question: Anyone knows the reason, why the script isn't working on my side?
Last edited by Arch4GoodieLike; 01-07-2021 at 01:50 PM.
usage()
{
cat <<EOF
Meme
Description: A lightning fast meme generator
Usage: tool [flags] or tool [flags] [arguments]
-u Update Bash-Snippet Tools
-h Show the help
-f Choose the output filename
-v Get the tool version
Examples:
meme -h
meme -f dogeMeme
EOF
}
agent="Mozilla/5.0 (Windows NT 10.1; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0"
curl -A "$agent" https://memegen.link/dog/cat/test.jpg -o test.jpg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Excuse the brief confusion Arch4GoodieLike, until you edited your original, it was unclear what the particular problem was, although there were some clues.
I agree that teckk has it covered fairly well and suggest if you desire to modify the httpGet() function cited and try to create the meme.
An additional thing you can do if you continue to see problems, is to put a "set -xv" line just after the first line of the script. This will enable verbose and debug output when you run the script, you should see how the script progresses through the main and functions and see the detailed output if there are additional errors.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.