Re: awk or sed

2011-04-05 Thread Andres Perera
On Tue, Apr 5, 2011 at 10:39 PM, ali hagigat wrote: > I have a variable like this: > var1=Makefile .xcompile /root/build/.config src/arch/i386/Makefile.inc > means some words separated by spaces. I want to print each word on a > separate line. I think I have to use "awk" or "sed" string processing

Re: ReadLines and Substraction

2011-03-14 Thread Andres Perera
benign dead code: >>> >>> If you can help me with this, will be very happy for that. Thanks in >>> advance. > > #!/usr/bin/env bash > > set -e > > if [[ $(type -t 'mapfile') != 'builtin' ]]; then > function mapfile > { > while getopts C:c: f > do >

Re: ReadLines and Substraction

2011-03-14 Thread Andres Perera
On Mon, Mar 14, 2011 at 6:38 AM, pk wrote: > yetcom wrote: > >> Hello Everyone, >> >> I have an issue regarding the bash. I have 2 different files and each >> of them involves some float point numbers for each lines. I want to >> subtract each line then put all the results into a file. The first >

Re: bash doesn't act like mksh at all

2011-02-28 Thread Andres Perera
On Mon, Feb 28, 2011 at 7:41 AM, Chris F.A. Johnson wrote: > On Mon, 28 Feb 2011, Andres Perera wrote: > >> for i in bash mksh; do >>   echo $i: >>   $i <<'!' >>       set 'a  b' 'c  d' >>       quoted="$@" >

bash doesn't act like mksh at all

2011-02-28 Thread Andres Perera
for i in bash mksh; do echo $i: $i <<'!' set 'a b' 'c d' quoted="$@" unquoted=$@ echo "$quoted" echo "$unquoted" ! done here bash treats unquoted $@ on rhs differently, expanding it like $*: bash: a b c d a b c d mksh: a b c d a b c d p