« first day (2840 days earlier)      last day (2097 days later) » 

7:44 AM
@pabouk I would agree with @Jesse_b on the review here. The change is correct, but substantial enough that it warrants not just a code change but also some explanation (it's not fixing a simple typo). In these cases, I tend to alert the user (and readers) about it in a comment instead (just like you did later).
 
 
4 hours later…
11:17 AM
Hello guys Iam new to Bash scripting
Could you guys help me out with Bash scripting queries
 
@BasilPaul That is literally one of the reasons this site exists. You should first do some searching on the main site to see if your issue has been addressed before (which is likely). You may ask about asking here, and possibly about very minor issues, but this chat is not primarily for answering full blown scripting problems (we mostly chat about the weather and share the occasional Unix tidbit).
 
Okay. Thankyou
 
@Kusalananda "mostly chat about the weather"?
It's a lot more wide ranging than that.
 
@BasilPaul No, that last part is not entirely true, we chat about almost anything here, but Unix-related topics are on topic and questions should primarily be asked on the main site (or you could ask here if anyone has seen a related question in the past).
@BasilPaul You are most welcome.
 
@Kusalananda
Let me explain the problem that Iam going through. I find difficulty in understanding the flow of scripts or at some point I get stuck without having a clue. Could you help me out with that
I have been literally struggling with this problem. I get stuck at some point in the script and find it difficult in moving ahead. Could you please help me out with that
 
11:42 AM
@BasilPaul @Kusalananda is known for being very helpful. But you should not abuse that. Try to find a specific question to ask. Then ask it.
Preferably on the site. You could always hang out here after asking the question. That can be useful if people want clarifications.
 
@BasilPaul: How long is your script?
 
@BasilPaul A link to something to look at maybe? It's difficult to help when one doesn't know what the issue is. Or a short description of what you're attempting to achieve?
 
@Jesse_b
15 to 20 lines
Iam reffering a book named as Mastering_Unix_Shell_Scripting
 
11:58 AM
@BasilPaul That's not too long, you could put that whole thing into a question on here unless it has sensitive information. Or you could throw it on gist.github.com or something similar and post the link in here. We could look at your issue and either give tips to fix it or tips on asking a good question about it
 
Iam going through the first chapter and got stuck at a script. I coudnt understand what the author is trying to convey through the script. I tried google but didnt help
 
@BasilPaul what page is the script on?
 
@BasilPaul Without wanting to sound blunt, but get to the point ...
2
 
Page 35. Program A Rotating Line
 
function rotate_line
{
    INTERVAL=1 # Sleep time between “twirls”
    TCOUNT=”0” # For each TCOUNT the line twirls one increment
    while : # Loop forever...until this function is killed
    do
        TCOUNT=`expr $TCOUNT + 1` # Increment the TCOUNT
        case $TCOUNT in
            “1”) echo ‘-’”\b\c”
                sleep $INTERVAL
                Scripting Quick Start and Review 35
                Free & Share & Open
            ;;
            “2”) echo ‘\\’”\b\c”
                sleep $INTERVAL
 
12:01 PM
This is the one
 
Oh, ancient.
 
The book is for bourne, ksh, bash
 
Not for Bash?
 
Yes, for bash too
It's just that some of the command in there are not in common use anymore. To increment a number, one usualy does i=$(( i + 1 )).
And echo '-'"\b\c" ??
This assumes an echo that interprets escape sequences.
 
The "Scripting Quick Start and Review 35
Free & Share & Open"
Should not be in there, that came from the page break when I copy/pasted
 
12:05 PM
Better with printf '%s\b\c' "-"
@BasilPaul Anyway... What's the particular bit you're stuck at?
 
@BasilPaul Just in my opinion, sitting and reading a programming book isn't particularly useful. Unless you really know nothing about programming, it's better to try to write something.
And if you know nothing, shell isn't a particularly good starting point. You're better off with something like Python.
 
12:23 PM
@Kusalananda I will do the homework from my end first as there are lots of queries in the program. Thankyou for the support. Appreciate that
 
@BasilPaul: Take what @FaheemMitha says with a grain of salt. He's prejudiced against shell for some reason
 
@BasilPaul Hmm...
Here's a cleaned-up version of that function:
do_swirl () {
    interval=0.2
    while true; do
        case $(( ++tcount % 4 )) in
            0) swirl='-' ;;
            1) swirl='\\' ;;
            2) swirl='|' ;;
            3) swirl='/' ;;
        esac
        printf '%c\b' "$swirl"
        sleep "$interval"
    done
}
Here's a bash-specific version:
do_swirl2 () {
    swirl=( '-' '\\' '|' '/' )
    interval=0.2
    while true; do
        printf '%c\b' "${swirl[++tcount % 4]}"
        sleep "$interval"
    done
}
 
@Jesse_b Prejudiced means you're unfamiliar. I have written shell scripts.
 
Note that the function in the book uses the function keyword. That makes it not run in the Bourne shell.
 
I just don't think that shell is the best choice for a beginner.
 
12:36 PM
@FaheemMitha Well you unfairly dislike shell scripting. It's an extremely useful tool for anyone working on nix systems
 
You want a training-type language.
@Jesse_b I didn't say I disliked it. I said it's wasn't a particularly good choice for a beginner.
 
@FaheemMitha Depends on what one's a beginner at.
 
@Kusalananda Yes, of course, it depends.
As I wrote "And if you know nothing, shell isn't a particularly good starting point."
Nothing about programming, that is.
When I tried to learn programming, the first language I tried was C. Which was unnecessarily excruciating.
But I didn't know any better, and didn't get any good advice. SE wasn't around then. Python was still 1.0 then, but would have probably been a better choice, regardless. That was 1997.
Made an already hellish semester significantly more stressful.
Actually, I didn't even have my own computer then. Was trying to use a Sun C compiler on a Sun workstation. Sigh.
 
@FaheemMitha So both ends of the spectrum would be a bad starting point, you say? Not C nor shell scripting? I think this really comes down to personal taste and circumstances, as well as what one really wants to do.
 
IMHO for beginner it would be beneficial to have language which hasn't got too many quirks to allow focusing on the programming itself instead of the oddities of the particular language.
I would consider shell, C and php to have plenty quirky and noticeable details.
 
12:59 PM
Found a lot of very bad question lately is it always the case on holyday season ?
@Kusalananda I want your old profil picture back, the color suit you way better :D
 
@Kiwy You will just have to wait a bit... I happen to rather like this one.
 
1:16 PM
@Kusalananda I'm terribly disappointed... But this one is good as well
Still I prefer color of black and white
 
1:34 PM
s/of/over/
 
 
2 hours later…
3:09 PM
Just had a coworker storm out of the office because I asked them to do their job lol
 
3:33 PM
@Kusalananda By both ends, I take it you mean high level and low level languages?
It's not about that, it's really about a good language for beginners. Easy understandable, with a uniform/regular syntax.
Most "real" languages aren't great choices for beginners, imo.
Possibly something like Racket would also work, but I've never used that.
 
I think good languages for beginners are languages which encourage experimentation, so it’s more about the development environment than the language itself.
That’s why BASIC was so good, especially on early micros: you could quickly get graphics up on screen...
Same with LOGO, and the Python turtle nowadays.
 
@StephenKitt Python turtle?
I think Racket was supposed to have a good development environment. Wasn't it called Dr. Scheme once?
 
@FaheemMitha yes
Racket (formerly PLT Scheme) is a general-purpose, multi-paradigm programming language in the Lisp-Scheme family. One of its design goals is to serve as a platform for language creation, design, and implementation. The language is used in a variety of contexts such as scripting, general-purpose programming, computer science education, and research. The platform provides an implementation of the Racket language (including a sophisticated run-time system, various libraries, JIT compiler, and more) along with a development environment called DrRacket (formerly named DrScheme) written in Racket itself...
well, the language was formerly known as PLT Scheme, and has a development environment called DrRacket, formerly DrScheme
 
4:32 PM
@StephenKitt Lots of name changes.
Have you ever used Racket? I played with a bit once. It looked friendly.
 
@FaheemMitha not with Racket
I have played with Scheme
and Scheme is certainly beginner-friendly by my definition above
 
@StephenKitt I've heard Racket is supposed to be especially friendly.
Well, it's got a stretch backport, so clearly people are using it.
 
@FaheemMitha it does indeed
I should check it out some day
 
@StephenKitt That looks like something that is designed more for children. Perhaps in the spirit of the Logo programming language.
Which I also know nothing about.
 
@FaheemMitha yes, exactly, it’s designed around experimentation with immediate feedback
which is great for learning to program
as in, learning to do something on a computer
programmatically
 
4:44 PM
@StephenKitt I suppose so. But something designed for children might be a bit limited.
Though I suppose one could always move on to something more challenging.
I remember my first try at learning C++ was from one of those dummies books.
 
@FaheemMitha right, you’re not going to write an operating system in Logo, but it’s a foothold
Python Turtle is good in that respect because you’re learning Python
and you can do most things in Python
 
I got through a few hundred pages in a few days, then realised it probably wasn't the right book for me.
@StephenKitt Indeed you can.
Though sometimes slowly.
@derobert Well, I purchased that kitchen scale, finally. It's very exciting.
 
 
2 hours later…
6:41 PM
I wonder what this site's policy is going to be for WSL questions
 
@Jesse_b IMHO, they should be answered as any other questions. WSL is basically Ubuntu. The Windows part of it (installation, interoperability with Windows in general etc.) should be off-topic.
I'm using WSL on this laptop. But the only commands I ever type are ssh-agent bash, ssh-add and ssh box (box is my OpenBSD laptop).
 
@Kusalananda I agree, I don't have any experience with it but I'm sure there are going to be a lot of windows specific quirks as well. Also I think there is grey area in a question like this: unix.stackexchange.com/q/457231/237982
 
Yeah, I'm just going to stay clear of those questions.
 
:-P
 
Just like I do with anything I don't know anything about. I'm no mod, so I can only have an opinion, but never enforce it really.
 
6:47 PM
Well you could close vote
 
I don't vote to close questions I don't understand.
 
What if you don't understand it because it's unclear? :-P
 
That's another matter though. What I mean is that I don't vote to close a question on a topic I don't understand.
 
I'm thinking of situations like that or possibly configuring networking on WSL where there may require some windows configuration as well
Would be partially on topic and partially not
 
6:59 PM
@Jesse_b Buenos dais
 
@PrabhjotSingh Aloha
 
Sawa is still unanswered, Mr. AWOL
@Jesse_b Aloha
Everything alright.
 
Would WSL really be on topic?
 
@FaheemMitha I don't see why not for most questions but I have a feeling some of them are going to be dependent on the overlying windows configuration.
 
What is WSL?
 
7:05 PM
@PrabhjotSingh Windows Subsystem for Linux
At the command line, it looks and feels exactly like Ubuntu.
 
I should bite the bullet and upgrade to windows 10
 
7:18 PM
'yum -y install epel-release' why this is necessary for installing Mate on CentOS when gnome and kde could be installed by 'yum -y groups install "KDE Plasma Workspaces" or gnome Desktop
 
7:39 PM
@Jesse_b Well, to the extent that it's Linux, it sounds like it is Ubuntu. And the Windows side of things if off-topic by definition.
And this forum is mostly proprietary software free. It would be nice to keep it that way.
I think OS X is on topic in theory, but fortunately we never seem to see questions about it.
 
I think I've asked a few mac questions
also I don't think it's OSX anymore, it's macOS?
 
@Jesse_b Oh, ok.
@Jesse_b You've asked Mac questions here?
BTW, can anyone confirm that chat is just one big web page that is dynamically loaded a lot? And does it use technology like Ajax?
 
@FaheemMitha We also have questions for AIX and Solaris.
 
and RHEL
 
@Kusalananda Well, those are at least Unixes. Or Unices. And there aren't many of those.
@Jesse_b RHEL is free software.
 
7:53 PM
@FaheemMitha Is it? It's definitely proprietary...
 
@Jesse_b That's news to me. Red Hat only makes free software, as far as I know.
 
@FaheemMitha it's open source, but I don't think it's free
 
They do the branding thing, but that doesn't make it non-free.
@Jesse_b Those are basically synonyms, so I'm not sure what you mean.
 
@FaheemMitha They aren't and in fact you are the one who taught me that :-p
 
@Jesse_b I am?
I mean, they're functionally the same.
 
7:56 PM
@FaheemMitha Yes you used to talk about the free software community vs open source community a lot
 
The intention behind those terms is certainly different.
@Jesse_b Sure, but the definitions are functionally equivalent.
To all intents and purposes. I'm not aware of any exceptions.
But perhaps @StephenKitt, who works for RH, can offer a definitive answer.
 
Open source doesn't mean redistributable
 
Would also be a reasonable question for the Open Source SE.
@Jesse_b Sure it does. Check the definition.
The definitions are basically the same, as far as I know.
 
First, some open source licenses are too restrictive, so they do not qualify as free licenses. For example, “Open Watcom” is nonfree because its license does not allow making a modified version and using it privately.
It's in the GNU link I sent
 
@Jesse_b I was referencing the OSI use of the term, which I believe is standard.
People often use the term "open source" rather loosely, but then again, they do the same for the term "free software".
To be more precise, the OSI "open source" definition, the FSF "free software" definition, and Debian's Free Software guidelines are not (as far as I know) isomorphic, but when applied in practice, they virtually always yield the same result.
But it would make a very reasonable question for the Open Source SE. Though it might have been asked already.
The FSF article that you linked to somehow manages to not mention OSI at all.
I think they're trying to put people off using the term, so they probably don't want to link to it.
 
8:11 PM
Which agrees with me/GNU
 
@Jesse_b If you mean that there are differences, then yes.
But most of those exceptions are edge cases.
 
0
Q: Can't SSH into Raspberry Pi after changing permissions

Ctrl Ssudo chmod -R 777 / was entered in an attempt to regain access to directories that were previously accessible, but this caused the SSH connection to be closed and now can no longer be reconnected. A "Login failed." error is displayed. The Pi can still be accessed directly. Any use of sudo retu...

sudo chmod -R 777 / =(
 
@Kusalananda Does en.wikipedia.org/wiki/Nazneen_Rahman mean anything to you?
 
8:29 PM
@FaheemMitha I haven't met her.
 
@Kusalananda Oh, I just thought you might have heard something about this. A female Asian academic who bullys people. It just seems unusual.
Unfortunately I can't find any details at all.
From her name, she sounds like she might be Iranian.
 
Sounds like my kind of woman
 
@Jesse_b lol
 
@FaheemMitha Bangladeshi
 
@Kusalananda Oh? Where did you find that out?
 
8:41 PM
@FaheemMitha The Wikipedia page you posted :-)
 
@Kusalananda Oh, it says Bangladeshi at the bottom.
 
 
2 hours later…
10:22 PM
(╯°□°)╯︵ ┻━┻
I have to extract data from a string that is mostly delimited by - but...sometimes the value contains a -
Time for gray hair
 

« first day (2840 days earlier)      last day (2097 days later) »