Go fish! (developerWorks)
Thankfully, fish--the Friendly Interactive Shell--swims upstream against the tide of obfuscation, providing streamlined syntax and a much-improved user experience. Like other shells, fish provides redirection, shortcuts, globbing (that is, expansion of wildcards), subshells, tab completion, and variables. Unlike alternatives, however, fish also provides color-coded CLIs, an extensive command-line editor, and rich documentation."
Posted Dec 3, 2008 19:09 UTC (Wed)
by jengelh (guest, #33263)
[Link] (2 responses)
Posted Dec 3, 2008 22:57 UTC (Wed)
by JoeBuck (subscriber, #2330)
[Link] (1 responses)
Posted Dec 4, 2008 11:41 UTC (Thu)
by jengelh (guest, #33263)
[Link]
Posted Dec 3, 2008 21:02 UTC (Wed)
by emk (subscriber, #1128)
[Link] (10 responses)
1) "Here documents".
But all in all, it's a good idea. Unix shells have stagnated in recent years.
Posted Dec 3, 2008 21:42 UTC (Wed)
by tzafrir (subscriber, #11501)
[Link] (5 responses)
Posted Dec 3, 2008 23:48 UTC (Wed)
by nix (subscriber, #2304)
[Link] (4 responses)
(Recentish features include UTF-8 support, which now seems to have enough
Posted Dec 4, 2008 16:49 UTC (Thu)
by sitaram (guest, #5959)
[Link] (3 responses)
What would you say to a job-queuing program whose main "loop" is essentially the single statement "wait", and which did everything else by trapping SIGCHLD? Take a look at http://sitaramc.googlepages.com/queue.sh (but note: I wrote it for a lark and it seemed to work fine in testing but I never actually used it "in production")
Posted Dec 5, 2008 0:41 UTC (Fri)
by nix (subscriber, #2304)
[Link]
The code's not even contorted to fit: the 'one line at the end where
Posted Dec 5, 2008 3:11 UTC (Fri)
by sitaram (guest, #5959)
[Link]
I'm a perl guy normally, but I wrote this to show (show off?) a bunch of perl/python/java type kids what plain bash could do...
Posted Dec 5, 2008 9:42 UTC (Fri)
by njs (subscriber, #40338)
[Link]
Posted Dec 3, 2008 22:24 UTC (Wed)
by tyhik (guest, #14747)
[Link] (3 responses)
Like much of that basic unix and internet stuff. The rfc793 dates back to almost thirty years
Posted Dec 3, 2008 23:16 UTC (Wed)
by drag (guest, #31333)
[Link] (2 responses)
It's nice to see some change going on though.
Posted Dec 3, 2008 23:52 UTC (Wed)
by JoeBuck (subscriber, #2330)
[Link] (1 responses)
Posted Dec 6, 2008 16:02 UTC (Sat)
by dmag (guest, #17775)
[Link]
If you use Fish as your shell, then you can also use it to write Fish shell scripts. The "language" around the shell is a lot less arcane and has more conceptual integrity.
That said, I've tried to use fish as my main shell, and failed because it takes a while to learn. I couldn't figure out how to do "(sleep 1h; xmessage time to go) &".
Posted Dec 8, 2008 13:53 UTC (Mon)
by Richard_J_Neill (subscriber, #23093)
[Link]
I still do a *lot* of programming in bash, and it's pretty good. Just not perfect.
[1] Yes, I know this is really an OS feature. But still, why shouldn't a parent be allowed to explicitly access variables set in a subshell? This wouldn't be such a problem, except that subshells can only return a 1-byte integer exit value; rather than an array or a string.
[2] This needs some more explanation - here is an example:
ls *z
shopt -s nullglob
shopt -s failglob
What I want is for "ls *z" to be like listing an empty directory. i.e. bash gives ls an explicit argument of NUL.
Go fish! (developerWorks)
... since fish in the context of FTP over SSH is not typed as a command, rather it is used in URLs, always followed by a colon.
not really a name conflict
not really a name conflict
Go fish! (developerWorks)
2) The "VAR=value" notation. I've never really loved "set VAR value", personally.
On a zsh:
Go fish! (developerWorks)
% gpg --l[tab][tab]
--list-keys -- list all keys
--list-options -- modify what the various --list-*
--list-packets -- list only the sequence of packets
--list-public-keys -- list all public keys
--list-secret-keys -- list all secret keys
--list-sigs -- lists keys and signatures
--local-user -- use name as the user ID to sign
--lsign-key -- sign a key but mark as non-export
--list-only --lock-never --logger-fd
--lock-multiple --lock-once
Go fish! (developerWorks)
numbers of new features, but it already has so *many* that if it adds many
more the manual will collapse into a black hole.
of the bugs worked out of it to be useful, and exception handling, which
in any shell but zsh would have me spluttering in amazement. This being
zsh, though, it's not surprising: I fully expect I've just overlooked the
strong AI that can write your code for you, if you can figure out the
incredibly baroque syntax for telling it what to do.)
Go fish! (developerWorks)
Go fish! (developerWorks)
in deeply ugly ways that could have been done like that.
control sits forever' just falls out of it.
Go fish! (developerWorks)
Go fish! (developerWorks)
Go fish! (developerWorks)
Go fish! (developerWorks)
"Stagnation" just means that 10-year-old code still runs. Better to write a new scripting language than to incompatibly change an old one.
Go fish! (developerWorks)
Go fish! (developerWorks)
Some bash enhancements...
- syntax highlighting at the bash prompt (not just in editors). This idea is one we should take from fish.
- some sensible string functions with aliases defined so that we can use more familiar constructs eg strlen, rather than ${#string}
- trim() or chomp().
- more array functions, eg array_keys(), and multi-dimensional arrays
- a builtin to do path canonicalisation (like /usr/bin/readlink)
- a way to get variables back from subshells (the converse of EXPORT)[1]
- some hybrid of nullglob and failglob so that a mismatched glob results in null. [2]
mkdir test
cd test
touch a b c d
ls: cannot access *z: No such file or directory
#Normally, bash will fail to expand the *z, and will then pass it to
#ls as a literal '*z'.
ls *z
a b c d
#Bash now treats '*z' as empty, and runs ls with no parameters.
ls *z
bash: no match: *z
#Here, we get no match, but we get an error instead.
