🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: ch.comp.os.linux
Article #20599

Re: inhalt von variablen teilen

#20599
From: Felix Rauch
Date: Thu, 16 Sep 1999 00:00
22 lines
1283 bytes
Michael Lohrer <michael.lohrer@helvetiapatria.ch> wrote:
> sed is natuerlich die elegantere methode (dafuer auch die etwas
> anspruchsvollere *g* )

Beides ist ineffizient, da ein externer Prozess gebraucht wird. So
geht's auch:

--- schnippp ---
#!/bin/bash

domain="www.domain.ch"
echo domain $domain

toplevel=${domain:0-3:3}
echo toplevel $toplevel
--- schnapp ---

- Felix
-- 
Felix Rauch, research assistant @ ETH Zurich, Institute for Computersystems
Homepage: http://nice.ethz.ch/~felix/ (includes PGP public key)
Email: felix@nice.ch     -> This article contains my personal views only <-
Technical Details
Message-ID: <37e0e0d9@core>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37E0CC57.A9917635@access.diax.ch> <37E0D7D3.5ABA140F@moritzi.ch> <37E0D8DD.D4CC6BBD@helvetiapatria.ch>

Show Full Headers
Complete Article Headers
X-Google-Language: GERMAN,ASCII-7-bit
X-Google-Thread: f4b73,ba814cfaf86a68f6
X-Google-Attributes: gidf4b73,public
From: felix@nice.usergroup.ethz.ch (Felix Rauch)
Subject: Re: inhalt von variablen teilen
Date: 1999/09/16
Message-ID: <37e0e0d9@core>
X-Deja-AN: 525835534
Sender: Felix Rauch <rauch@cs-zz4.ethz.ch>
References: <37E0CC57.A9917635@access.diax.ch> <37E0D7D3.5ABA140F@moritzi.ch> <37E0D8DD.D4CC6BBD@helvetiapatria.ch>
X-Original-NNTP-Posting-Host: cs-zz4.inf.ethz.ch
X-Trace: 16 Sep 1999 14:21:48 +0100, core.inf.ethz.ch
Organization: ETH Zurich
User-Agent: tin/pre-1.4-980618 (UNIX) (Linux/2.2.7 (i686))
Newsgroups: ch.comp.os.linux