Re: expr help

From: andre willkowsky (andre_at_gmx.de)
Date: 08/31/04


Date: Tue, 31 Aug 2004 19:05:01 +0200

Hi,

Stephane CHAZELAS wrote:

> 2004-08-31, 16:03(+00), foo@bar.com:
>> Hey kids,
>>
>> Is there an easy way to do the following:
>>
>> foo="a:b:c:d:e:f"
>>
>> bar="d"
>>
>> expr <insert code here to remove ${bar} from ${foo}>

if you like to try it with bash you can use
foo="a:b:a:d:e:a";
bar="d";
echo ${source//${a}:/}

Greetings
Andre



Relevant Pages

  • Re: awk NF
    ... Stephane CHAZELAS wrote: ... >Michael Wang wrote: ... >> echo $# ... should always work (ksh88, ksh93, bash). ...
    (comp.unix.shell)
  • Re: PATH variable
    ... Floyd L. Davidson wrote: ... >>which should result in echo $PATH ... configuration files before bash invokes /etc/profile ... > come to a single line in a single file that in fact does modify ...
    (comp.os.linux.misc)
  • Re: Bash script - telnet
    ... > I need a telnet script in bash. ... (echo user your_username ... Notice that "echo" preceeds the commands to the remote server. ...
    (comp.unix.questions)
  • Re: Probably very stupid script/bash question
    ... both solutions work perfectly under bash. ... echo "Data received = $E Bytes" ... If the first line has white space, then as many variables as there are "fields" in the line will contain values. ... you must have one or more white spaces between the two 'less than' symbols and NO space between the 'less than' and the 'left parenthesis'. ...
    (Debian-User)
  • Re: Error returns not handled correctly by sysfs.c:subsys_attr_store()
    ... Andrew Patterson wrote: ... Used /bin/echo instead of the built-in echo command. ... Zsh and Bash both fail. ... AMD running Debian lenny with i686 kernel -- fails. ...
    (Linux-Kernel)