Skip to content
This repository has been archived by the owner on Jan 3, 2018. It is now read-only.

Fix references to "goostats" in beginner shell looping material #254

Merged
merged 4 commits into from
Jan 27, 2014

Conversation

rhiever
Copy link
Contributor

@rhiever rhiever commented Jan 25, 2014

I added the goostats and goodiff programs, as they are discussed in the materials (but currently not existing).

I also fixed references to goostats in the example code by appending bash in front of them, otherwise the goostats calls will not work.

@wking
Copy link
Contributor

wking commented Jan 25, 2014

On Fri, Jan 24, 2014 at 09:28:12PM -0800, Randy Olson wrote:

I added the goostats and goodiff programs, as they are discussed
in the materials (but currently not existing).

Can't we just use the POSIX commands from goostats:

head -3 $1 | cut -d , -f 1 | sort | uniq > $2

out of the box? I don't think a local script with a wonky name really
does that much to help avoid distraction :p. If we want something
even simpler, I'd suggest:

$ for datafile in *[AB].txt; do echo $datafile; wc $datafile > stats-$datafile; done

And remind the students that they could replace wc with any program
the want, but that we were focusing on the loop syntax at the moment.

If we do want a local script, I think it deserves an intuitive name,
comments, ….

I also fixed references to goostats in the example code by
appending bash in front of them, otherwise the goostats calls
will not work.

You're just missing a #/bin/sh shebang 1.

@wking
Copy link
Contributor

wking commented Jan 25, 2014

On Sat, Jan 25, 2014 at 02:11:56PM -0800, W. Trevor King wrote:

You're just missing a #/bin/sh shebang [1].

Oops, #!/bin/sh ;). If you really want Bash (and not
POSIX-compatibility), you can use #!/bin/bash. Pick whichever
interpreter you like (e.g. #!/usr/bin/env python, …).

@rhiever
Copy link
Contributor Author

rhiever commented Jan 25, 2014

Can't we just use the POSIX commands from goostats:

The narrative in the novice bash material is that goostats and goodiff are programs provided by the adviser, so really the students should never be looking in there (unless they're curious).

You're just missing a #/bin/sh shebang

Well, I appended bash to call the program because that's how the novice materials teach them to call scripts that they wrote.

These commits are just patching the novice shell material, not adding anything new. If we want to discuss changing the novice shell material, that's a separate issue IMO. :-)

@wking
Copy link
Contributor

wking commented Jan 25, 2014

On Sat, Jan 25, 2014 at 02:28:01PM -0800, Randy Olson wrote:

Can't we just use the POSIX commands from goostats:

The narrative in the novice bash material is that goostats and
goodiff are programs provided by the adviser, so really the
students should never be looking in there (unless they're curious).

Ah, fair enough. I'm ok with the new scripts then, but I think they
deserve comments about their purpose, expected usage, etc. If they're
supposed to be instructor-supplied black boxes, maybe we can get away
with an unexplained shebang? I see very few explicit-Bash invocations
in the wild (although they are more common in the Python ecosystem,
possibly due to the diversity of Python interpreters?).

You're just missing a #/bin/sh shebang

Well, I appended bash to call the program because that's how the
novice materials teach them to call scripts that they wrote.

These commits are just patching the novice shell material, not
adding anything new. If we want to discuss changing the novice shell
material, that's a separate issue IMO. :-)

Good idea. I've opened #255 and #256 addressing shebangs and
loop-vs-script ordering.

@ahmadia
Copy link
Contributor

ahmadia commented Jan 26, 2014

I'm +1 for merging this. I still think it would be better to shebang these scripts, since they are supposed to be "programs", but I'm okay with having Nelle call them as bash scripts as well :)

gvwilson pushed a commit that referenced this pull request Jan 27, 2014
Fix references to "goostats" in beginner shell looping material
@gvwilson gvwilson merged commit 70508c5 into swcarpentry:master Jan 27, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants