« first day (3176 days earlier)      last day (1761 days later) » 

4:30 AM
@derobert Both the R and Common Lisp REPLs echo 1, FWIW.
For a scripting language, I'd say it's quite common behavior. But no doubt my ignorance of programming languages lulled me into a false sense of uniformity.
 
 
3 hours later…
7:36 AM
Some Linux distro use /bin as a folder, some use /bin as a symlink of /usr/bin. Is this any kind of rule or just a choice?
 
@Biswapriyo AFAIK, /bin and /usr/bin are distinct things. Check the LHS.
 
Check arch.
 
@Biswapriyo The Arch FAQ says that choice is because of systemd: wiki.archlinux.org/index.php/…?
 
20 years down the line, Linux will just put everything in the root folder...
 
7:52 AM
(Sorry, the chat box breaks the link on the ').
 
@fra-san Understood 👍
 
@fra-san It doesn't say that at all
Lots of systems have unified the /usr and / entries for a long time now
 
8:14 AM
@MichaelHomer I was just referring to the sentence "Arch Linux follows the file system hierarchy for operating systems using the systemd service manager".
 
@fra-san I know what sentence you were referring to, it just doesn't say that
 
@MichaelHomer Right, it looks like I misread it, thank you. I see the Arch developers have explained their rationale (e.g. lists.archlinux.org/pipermail/arch-dev-public/2012-March/…) without any mention to systemd.
 
Yeah. It's hard to see the value in it for a consumer-level system these days
 
8:58 AM
Someone at work spotted the following pipeline in a bioinformatics-related forum: ls *.gz | awk '{print "gunzip " $0}' | bash
Never write code like that!
It's a case of "I know I can do this with that command, and that with this command", but not knowing how to properly combine them, or when it's apropriate to do so.
 
9:10 AM
i.e. virtually all bioinformatics code
A few years ago I had some in front of me and it had the most enormous command substitution in the middle, and all it did was unconditionally output "0" after a chain of several awks and greps. But presumably at some point all the bits made sense
I really feel that a slightly more practical software carpentry-type training would be a huge help
 
9:27 AM
@MichaelHomer We do have both Unix and Python training for our bioinformatics students and Ph.D. students (and post-docs, and other staff) here, and part of my work is to make sure that the people that teach those classes know what they are talking about.
 
@Kusalananda Does it work?
 
The issue is that when you're taught that you "get a list of files with ls", then this will be how you get a list of files, in loops, in pipelines and everywhere else.
 
Yes, and then everything looks like a nail
Shell scripting really just is not suited for the task at all, on top of all the usual bad things about it
 
@MichaelHomer To some degree. We have a Slack channel called "#Unix-tools" that I run, and it works more or less as a micro-U&L forum.
 
 
2 hours later…
Tim
11:01 AM
@MichaelHomer Interesting. What is "a slightly more practical software carpentry-type training " like?
 
11:41 AM
@fra-san Yes, FHS, not LHS, sorry.
I am acronym-challenged.
 
@FaheemMitha Actually I just thought LHS was something I didn't know/I couldn't remember of. I agree that acronyms are hard.
 
 
5 hours later…
4:46 PM
What does main "$@" mean in shell script?
 
@overexchange The script was written with a function called main that essentially does all the execution
Within the script that function is being called with all the arguments that were passed to the script
$@ represents all the script parameters so if you called it as: ./script.sh foo bar baz it will essentially be calling main foo bar baz. Inside main $1 = foo, $2 = bar, and $3 = baz
 
5:38 PM
set -- hello world
main () {
	printf '%s ' "$@"
}
>/dev/chat main "$@"
 
6:34 PM
Does anyone use lastpass on macos?
 
6:54 PM
64
Q: What is the difference between $* and $@?

rahmuConsider the following code: foo () { echo $* } bar () { echo $@ } foo 1 2 3 4 bar 1 2 3 4 It outputs: 1 2 3 4 1 2 3 4 I am using Ksh88, but I am interested in other common shells as well. If you happen to know any particularity for specific shells, please do mention them...

 
set -- echo hello Jeff
$@
 
sh -s <<END
cat
remember to quote your
variables Jesse
END
 
7:10 PM
set -- echo fine!
'$@'
:)
 
7:51 PM
@Jesse_b eval $(rev <<< 'esseJ ,olleH ohce')
 
@JeffSchaller Nice
 
8:40 PM
@JeffSchaller printf '\325\211\203\205\045' | dd conv=ascii 2>/dev/null
 
decent
 

« first day (3176 days earlier)      last day (1761 days later) »