[gentoo-user] OT: cut replacement with bash builtins

2011-02-27 Thread Florian Philipp
Hi list! I'm currently streamlining some of my shell scripts to avoid unnecessary process calls where bash itself is powerful enough. At the moment, I want to replace stuff like this: string='foo:bar:foo' second_field=$(echo $string | cut -d : -f 2) # should read bar My current solution is

Re: [gentoo-user] OT: cut replacement with bash builtins

2011-02-27 Thread Alex Schuster
Florian Philipp writes: I'm currently streamlining some of my shell scripts to avoid unnecessary process calls where bash itself is powerful enough. At the moment, I want to replace stuff like this: string='foo:bar:foo' second_field=$(echo $string | cut -d : -f 2) # should read bar My

Re: [gentoo-user] OT: cut replacement with bash builtins

2011-02-27 Thread Florian Philipp
Am 27.02.2011 22:06, schrieb Alex Schuster: Florian Philipp writes: I'm currently streamlining some of my shell scripts to avoid unnecessary process calls where bash itself is powerful enough. At the moment, I want to replace stuff like this: string='foo:bar:foo' second_field=$(echo