Hi,
Paul de Weerd schrieb:
> | > Michael wrote:
> | $ X="abcdefghi"
> | $ echo $X | cut -c 1-2
> | ab
>
> Note that it's not a complete replacement for bash's
> ${parameter:offset:length} parameter expansion implementation. If you
> give it @ or an array as a parameter, behaviour is completely
>
Michael wrote:
Hi,
I am looking for sh/ksh replacement for the following bash command:
$ X="abcdefghi"
$ echo ${X:0:2}
ab
Anyone got an idea?
Michael
How about this:
$ echo ${X%${X#??}}
ab
${X#??} is $X with the first 2 characters (??) removed.
${X%Z} is $X with Z removed from
Michael <[EMAIL PROTECTED]> wrote:
> I am looking for sh/ksh replacement for the following bash command:
>
> $ X="abcdefghi"
> $ echo ${X:0:2}
> ab
echo ab
Yes, I'm being facetious, but without context it's not clear what an
appropriate "replacement" would be. Traditionally, the regular
expres
On Fri, Feb 08, 2008 at 05:03:40PM +0100, Michael wrote:
| Hi,
|
| Han Boetes schrieb:
| > Michael wrote:
| >> I am looking for sh/ksh replacement for the following bash command:
| >>
| >> $ X="abcdefghi"
| >> $ echo ${X:0:2}
| >> ab
| >
| > cut(1)
|
| Thanks a lot, sometimes the obvious solutio
Hi,
Han Boetes schrieb:
> Michael wrote:
>> I am looking for sh/ksh replacement for the following bash command:
>>
>> $ X="abcdefghi"
>> $ echo ${X:0:2}
>> ab
>
> cut(1)
Thanks a lot, sometimes the obvious solutions are the hardest to find...
$ X="abcdefghi"
$ echo $X | cut -c 1-2
ab
:-)
Mic
Michael wrote:
> I am looking for sh/ksh replacement for the following bash command:
>
> $ X="abcdefghi"
> $ echo ${X:0:2}
> ab
cut(1)
# Han
6 matches
Mail list logo