Afficher un message
Vieux 23/08/2006, 15h16   #16
Stephane Chazelas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: shel script problem regarding arrays

On 23 Aug 2006 05:47:22 -0700, Danish wrote:
[...]
>> #! /bin/sh -
>>
>> cd /home/danish/scp || exit
>>
>> {
>> ls # list local files
>> ssh -n 192.168.10.98 '
>> cd /home/danish/scp && ls' # list remote files
>> } | sort | uniq -d | sed 's/./\\&/g' | xargs rm -f --

[...]
> I copied you script and named it "remove_files.sh". But when I ran it
> ,the following error was reported.
>
> ./remove_files.sh
> sed: -e expression #1, char 8: unterminated `s' command

[...]

That script as it is may have some errors as I've not tested it.
However, the sed command should be OK.

I'd suggest you double check what you've copied into your file,
and maybe as well start to think by yourself, and read sed man
page for instance to understand why it doesn't work.

--
Stephane
  Réponse avec citation
 
Page generated in 0,05111 seconds with 9 queries