Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: removing spaces from a file name
- X-seq: zsh-users 12511
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: d.henman <dhenman@xxxxxxxxx>
- Subject: Re: removing spaces from a file name
- Date: Wed, 30 Jan 2008 23:40:16 +0100
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=RrOvctnFvNSzccGcBXz0abdRHuMLe4+OsSe7USKpRqE=; b=mWL+WcBNEC6VfAdY81PhuZdiOB7kuTY3DS7bvsj0687tT/iJ0/u6XB1EeGDf6cFZV+9brKESQnT3/H9xKMARE95H+8xTR7EZ7wL3JPsy+xzQI1NhaLPsANBAOgcgtZUkYXQDnhA/tnpTixZFlguuErtSifMbvlCcxfFK/90Ta4g=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=K2d5ft3NoIhoe+SDHq35XVf0ypPqQfOUk7ABMxT0yJ09+smPmHwjrQv0vLC1hUIs/mMo9W8oH0l1+UyrRvL3bu9VwnclScGoI6B05TgEDGEKYKqxjhVN9Kbp+WV4csTdpd9VRAGHdsKqW9VkpMflG82DlfI+3yP9eEPxqa6mJiM=
- In-reply-to: <20080131073305.1472@blackhawk>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns9A3574A71769Dzzappergmailcom@xxxxxxxxxxxx> <237967ef0801300341u1af07b2l1a4aece5614e09dd@xxxxxxxxxxxxxx> <237967ef0801300356q6fe00738ha11723966ce400fe@xxxxxxxxxxxxxx> <20080131073305.1472@blackhawk>
On 30/01/2008, d.henman <dhenman@xxxxxxxxx> wrote:
>
> I found that I also had to add code to translate Japanese encoded spaces in the following way. This is a two byte code 0x81 0x40. I just built a script to remove the ascii and Japanese space codes as follows:
>
> sed -b -e s/' '/_/g $TEMP_FILE >$TEMP_FILE1
> mv $TEMP_FILE1 $TEMP_FILE
> sed -b -e s/`echo -n "\x81\x40"`/_/g $TEMP_FILE >$TEMP_FILE1
> mv $TEMP_FILE1 $TEMP_FILE
>
> It could be made prettier, but it works as is and I left it.
>
> The point is that there may be other space characters than 0x20 in European languages, or it this covered in zsh?
I don't think spaces except the 0x20 one are as big a problem since
they don't cause trouble with word splitting. And it looks like your
script is about editing files, not renaming them?
(you can simplify your script by giving two -e switches to one sed
call, or one regex with a | in it. if you're using gnu sed you can
further simplify it with the -i switch.)
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author