bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A little but curious problem with sed


From: Danilo Spada
Subject: A little but curious problem with sed
Date: Wed, 28 Aug 2002 14:35:05 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

Hello !

I'm working with a lot of file for a research and I need to delete some text in them.
Their names are something like these:
        +01-1
        +01-2
        +02-1
        ...
        -01-1
        -01-2
        -02-1
A friend of mine suggest me to write this little file:
#####################################################################
# begin cut

#!/bin/sh

for file in *; do
  sed -e 's/Push event at --> 00://' "$file" > "new$file";
done

# end cut
#####################################################################

It works fine for the '+0...' file but for the others I get this problem:
        

#####################################################################
# begin cut

sed: opzione non valida -- 0
...

#
# (a cut of mine) or
#

sed: opzione non valida -- 1
Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...

  -n, --quiet, --silent
                 suppress automatic printing of pattern space
  -e script, --expression=script
                 add the script to the commands to be executed
  -f script-file, --file=script-file
add the contents of script-file to the commands to be executed
      --help     display this help and exit
  -V, --version  output version information and exit

If no -e, --expression, -f, or --file option is given, then the first
non-option argument is taken as the sed script to interpret.  All
remaining arguments are names of input files; if no input files are
specified, then the standard input is read.

E-mail bug reports to: address@hidden
Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.

# end cut
#####################################################################

Could you suggest me a solution ?

Thank you for the attention and
Have a GOOD day ;-)

Bye bye,
Danilo

--
Danilo Spada
Istituto di Psicologia della Facolta' medica
Universita' degli Studi di Milano
http://users.unimi.it/psychol





reply via email to

[Prev in Thread] Current Thread [Next in Thread]