Live data from Hacker News

Miguel de Icaza: Learning Unix

tirania.org

111–120 of 128 posts

Re: Miguel de Icaza: Learning Unix

#111
post #74
post #37

Earlier quoted context omitted.

While this argument might have held weight once, I think these factors undermine it: Emacs used to be considered 'expensive' in terms of disk/memory. These days, it really isn't. Non-Linux unixes are less and less of a factor these days, and even most of those have some sort of packaging system where installing emacs is a quick operation, rather than a laborious download/compile/install. Emacs itself has remote editi…

It's still valid. I haven't had to use vi in awhile but there are still a lot of OSes that don't have emacs installed by default. And every so often you'll wind up on a system where EDITOR isn't set and you'll get stuck in vi by accident. The thing is, though, the subset of vi you have to learn to is relatively small. You need to know how to enter and leave insert mode, how to delete, and how to quit with and without…

> the subset of vi you have to learn to is relatively small. You need to know how to enter and leave insert mode, how to delete, and how to quit with and without saving. (For a non-vi user, the difference between knowing and not knowing those simple things is significant)

As a self-learner out in the wilderness, I don't know how I could have learned Linux without learning that basic Vi alongside. And that really is all you need to know.

Re: Miguel de Icaza: Learning Unix

#112

Earlier quoted context omitted.

Learning the different things you can do with bash scripts, especially the string operations, made me a lot faster at doing batch tasks from the command-line. For longer-term scripts over a few lines, it's easier to use a powerful language you're comfortable with (maybe one of Perl, Python, Ruby) than to waste time (re)learning shell scripting whenever you need to extend the script.

Since OP's subject is becoming a better Unix hacker, I recommend staying away from Bash's more advanced (or just useful) features. The more Unix you touch, the more you realize you can't rely on Bash to work how you expect it across all different systems (if they have Bash installed). You will end up relying more on sed, awk, grep and your shell scripting will become more generic - but more portable. On the other han…

I tend to agree with you. When I write scripts, I target sh, not bash. If it doesn't fit in sh, then I look at a dedicated scripting language (perl/ruby/python) that will almost certainly be a better fit.

Re: Miguel de Icaza: Learning Unix

#114

Earlier quoted context omitted.

Learning the different things you can do with bash scripts, especially the string operations, made me a lot faster at doing batch tasks from the command-line. For longer-term scripts over a few lines, it's easier to use a powerful language you're comfortable with (maybe one of Perl, Python, Ruby) than to waste time (re)learning shell scripting whenever you need to extend the script.

Since OP's subject is becoming a better Unix hacker, I recommend staying away from Bash's more advanced (or just useful) features. The more Unix you touch, the more you realize you can't rely on Bash to work how you expect it across all different systems (if they have Bash installed). You will end up relying more on sed, awk, grep and your shell scripting will become more generic - but more portable. On the other han…

Most shell scripts are a collection of undeclared external dependencies. You can't really rely on sed, awk, and grep to behave the same way on Linux as they do on Solaris or AIX.

It seems like if you're concerned with portability, you shouldn't be writing a shell script in the first place.

Re: Miguel de Icaza: Learning Unix

#115

Earlier quoted context omitted.

Well, I guess there's no memetically famous touch-typing tutorials software for Linux or Mac. In fact, the only other memetically famous touch-typing software I know of is Typing Of The Dead¹, and that's not exactly widely-available. ¹: http://en.wikipedia.org/wiki/The_Typing_of_the_Dead

In the 80s, I learned how to touch type by playing Infocom games like Zork. The key to learning how to touch type is just typing _a lot_. You might not be very fast (I'm not), but you can at least get your eyes off your keyboard and use more than one finger per hand.

>The key to learning how to touch type is just typing _a lot_.

Absolutely. I don't think that typing-tutor software really does very much teaching at all, it's just a good tool for drilling yourself. But why not have fun in the process, rather than boring and mindless drills? I learned by playing the early Sierra adventure games, before they switched to the all-point and click interface.

Now I'm feeling all nostalgic...time to go download ScummVM.

Re: Miguel de Icaza: Learning Unix

#116

Earlier quoted context omitted.

I'm serious, not trying to be an ass here: Is emacs? It seems to me that both religions are not 'standard' anymore. I tend to see pico, nano, joe etc. - occasionally vi (but not vim).

"Ed is the standard text editor."

Ed really is worth learning, if only the basics. No matter where you end up, ed should be around. Even if you find yourself logged on to a Plan 9 box via telnet or something, ed will be there. Plus, the commands transfer to vi, and the ed command language is essentially the same as the sed command language! (and the Sam command language, used in the sam and acme editors, but those aren't as popular :)

Re: Miguel de Icaza: Learning Unix

#117

Earlier quoted context omitted.

Since OP's subject is becoming a better Unix hacker, I recommend staying away from Bash's more advanced (or just useful) features. The more Unix you touch, the more you realize you can't rely on Bash to work how you expect it across all different systems (if they have Bash installed). You will end up relying more on sed, awk, grep and your shell scripting will become more generic - but more portable. On the other han…

Most shell scripts are a collection of undeclared external dependencies. You can't really rely on sed, awk, and grep to behave the same way on Linux as they do on Solaris or AIX. It seems like if you're concerned with portability, you shouldn't be writing a shell script in the first place.

Au contraire, shell script in a (real) POSIX environment is one of the most portable things... It's interpreted and there's always some kind of shell on any Unix system, unlike other interpreted languages. That's why lots of 3rd party vendors use shell scripts to package their setup tools.

Yes the tools behave differently on different systems, but 99.9% of the time there's very basic syntax that is respected across all versions of the tools. Stick to BSD4.4 C Shell syntax (http://docs.freebsd.org/44doc/usd/04.csh/paper.html), don't rely on regular expressions in grep, and stick to the very basics of sed and awk and you can go pretty far in Unix.

Any of the following commands which existed on some archaic version of Unix will still exist and their limited but useful functionality can be extended in lots of ways, and is pretty darn portable. https://secure.wikimedia.org/wikipedia/en/wiki/List_of_Unix_...

Re: Miguel de Icaza: Learning Unix

#118

Earlier quoted context omitted.

Indeed. As part of my PhD duties, I've been the lab tutor for the first serious UNIX/systems programming course for the last three years, and I always teach vi: ESC : q! Because you never know when some commandline tool is going to drop you into vi (I teach them about the EDITOR variable, but sometimes you ssh somewhere and, you know...), and you need to know how to get out. True story: the number one cause of issues…

I suggest using hg or git, neither of which have a lock.

That's certainly a possibility down the road.

Our tech staff has a gForge installation that has LDAP configured and all the other goop, but only supports svn. Not managing accounts, password resets, and the inevitable extra map from student id jgordon to login SassySystemsHax0r is a big win.

Since it's their first time using SCC, I already have to deal with "but I just forgot to commit!" for the first two weeks. I'm a little worried that with a DVCS, I'd then also have to deal with "but I committed -- what do you mean I have to push, too? Well, can you grade against the local timestamp?" And that will happen all quarter...

Re: Miguel de Icaza: Learning Unix

#120

I loved this: > Save yourself the embarrassment, and avoid posting on the comments section jwz's quote on regular expressions. You are not jwz.

I personally though this was quite hilarious:

"But unless you touch-type, you are neither awesome, nor you are in a position to judge the qualities of the world as an oyster or any James Cameron movies."

Thoroughly enjoyable read I must say.

Post reply on HN