swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 382 forks source link

OSX/Linux shell differences in teaching notes #594

Closed noamross closed 10 years ago

noamross commented 10 years ago

I added this section and included two differences found at the UC Davis workshop and another I've come across. There are a number of others (such as differences in sed options), but I've excluded them because they seem too advanced or esoteric to likely come up in these lessons. Unfortunately I have not found any source that documents these differences comprehensively.

wking commented 10 years ago

On Thu, Jul 10, 2014 at 02:47:53PM -0700, Noam Ross wrote:

Unfortunately I have not found any source that documents these differences comprehensively.

I think the best approach here is just to stick to POSIX, which should be supported on all of our systems, and avoid any extensions beyond that (since they aren't very portable).

  • OSX/Linux shell differences in teaching notes
  • There's no -I or --ignore in POSIX's ls 1.
  • There's only -n in POSIX's head 2.
  • ls, head, and likely most other POSIX utilities (except find 3, that old rascal) expect the options to come before any positional arguments [1,2].
rgaiacs commented 10 years ago

I think the best approach here is just to stick to POSIX

Agree.

@noamross What about moving this not as the first item at "Teaching Notes" section?

@wking Do you know how to the the POSIX "man page" from the terminal? AFAICT using man will get the documentation from GNU Project.

wking commented 10 years ago

On Thu, Jul 10, 2014 at 03:30:53PM -0700, r-gaia-cs wrote:

Do you know how to the the POSIX "man page" from the terminal? AFAICT using man will get the documentation from GNU Project.

POSIX man pages should be installed in '*p' sections 1. So general POSIX commands are stored in section 1p. That means:

$ man 1p ls

will give you the POSIX docs for ls.

noamross commented 10 years ago

In practice will instructors know the difference between POSIX-compliant commands and extensions? I think its useful to have a list of likely trip-ups.

wking commented 10 years ago

On Thu, Jul 10, 2014 at 03:45:53PM -0700, Noam Ross wrote:

In practice will instructors know the difference between POSIX-compliant commands and extensions?

Maybe not, but the lesson material should only list POSIX commands. If instructors (or students) wander off the beaten path, you just need a general idea in the back of their mind reminding them that not everything their system supports will be on all POSIX systems. Trying to enumerate the differences seems like a lot of work, and I could certainly not internalize a large list of such extensions. Trying to pick out “important” differences also sounds difficult.

noamross commented 10 years ago

I've updated this to be more general.