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.
stop with the cussing and the getting angry. just go bother another thread. did you have questions here, or are you just here to troll? just go away.
edit: you can't make the script work. you're pasting from manpages with no idea what the actual problem is. you came here in the first place to start a flamewar and troll. just GO. AWAY. you're not answering my question or helping me understand anything. your only intention is to try and belittle me while offering nothing constructive. just don't reply again. find something else to occupy your time.
Last edited by like100ninjas; 12-16-2015 at 03:57 AM.
Reason: had to underline the go away part
$ read -r line
bla bla
$ echo $line
bla bla
$ foobar=$( read -r line_2 )
bla blubb
$ echo $foobar
$ echo $line_2
$
So, as you correctly suggested, the read command happens in a subshell, and the assigned value of the line variable will never become available in your script.
On top of that, the read command does not write anything to stdout, so the $() returns an empty string. Hence, the length of the string (-n test) will never be non-zero, and your condition will never be true.
What you need to do is e.g. this:
Code:
read -r line
while [[ -n $line ]] {
echo "You typed: "$line
# do stuff
read -r line
}
(I am sure it can be done in a more elegant way, but you get the point)
edit: once again, trying to make this lemonbar script work. i fixed all the error messages, and the script runs. i think my problem might be that i'm testing `read -r line' in a subshell, so the script never really parses the lines i'm trying to read. just a hunch. anyone know how to fix this? or maybe something else is wrong.
edit again: i keep trying different things but no text shows up on the bar still. i've tried adding "print $line" underneath the while line and nothing shows up.
$HOME/etc/lemonbar/panel_bar
Code:
#!/usr/bin/zsh
off of another place on netland -> and lemonBar -> example
Code:
#!/usr/bin/bash
# Define the clock
Clock() {
DATE=$(date "+a b %d, %T")
echo -n "$DATE"
}
# Print the clock
while true; do
echo "%{c}%{Fyellow}%{Bblue} $(Clock)%{F-}"
sleep 1;
done
Pont is: it is using BASH too
I use i3Status (bar) myself
though that seems rather simple, have you tried typing it all out right, if it is the error that states it is near } -- usally means you might have something within that file that is tossing an error, as I seen no missing quote marks in the code.
you could try a fresh sheet of Epaper and write it out again or just saveAs over top of it, the same file, as well. to clean it up and seee if it might have been something within the file itself.
ot try a different info bar -- or just format and install fresh OS (just playing)
zsh, don't know but most likely it is a typo error missing something one of them really stupid formatting errors like a quote or a space missing or is there that is not suppose to be
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.