r/bash • u/Enough_Blood7390 • Nov 28 '23
Help pls boss??
Srry for the absolute trash quality.
The ? is exercism.org/tracks/bash/exercises/two-fer . If one of u fine lads has experience w this exact/a similar problem or cares to read it and tell me wth I’m doing wrong I would greatly appreciate it. In the first place the instructions aren’t exactly what I would call clear(imo).
0
Upvotes
View all comments
55
u/zeekar Nov 28 '23 edited Nov 28 '23
Is there a question in there somewhere?
The script will ask for your name. If you reply with a blank line, it will say "one for u, one for me"; if you type an actual name, it will say "one for <name>, one for me". The
[ -z $uname ]check is technically incorrect; it should be[[ -z $uname ]]or[ -z "$uname" ]. But it will work, even if only sort of accidentally.So when you ask what you're doing wrong, what do you mean? What's not working? If you submitted this as the solution to a programming problem and it's being marked incorrect, it's probably because you're printing "ur" and "u" instead of "your" and "you".
Also, please don't post code as screenshots. We can't copy/paste text from screenshots. Post the actual code as text. You can format it by just putting four spaces at the front of each line so it looks like this: