linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Stupid spaces
@ 2004-07-19 13:29 calin
  2004-07-19 13:56 ` Chris DiTrani
                   ` (4 more replies)
  0 siblings, 5 replies; 26+ messages in thread
From: calin @ 2004-07-19 13:29 UTC (permalink / raw)
  To: linux-admin


Hello all.

I know the following question is a dumb one, but I've tried to make a
script working and I'm stuck.

I'll try to isolate the problem as follows.

I have a script which at some moment during the execution, needs to cd.
So I assumed that the following would work:


file_path='"/some/where/Test Folder/"'
echo "$file_path"
cd "$file_path"

But surprise: it didn't. Every time I try to run it it gives me
something like:


$ ./cding.sh
"/some/where/Test Folder/"
./cding.sh: line 5: cd: "/some/where/Test Folder/": No such file or
directory
$

although the Test Folder exist, is in the right path (/some/where/Test
Folder) and it's permissions are 777.

Any idea?

TIA

Calin Cosma



---------------------------------------------------------------
Incearca acum noul sistem de dating oferit de portalul acasa.ro


^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Stupid spaces
@ 2004-02-13 19:13 urgrue
  0 siblings, 0 replies; 26+ messages in thread
From: urgrue @ 2004-02-13 19:13 UTC (permalink / raw)
  To: linux-admin

well since we're all sharing space-removal tactics, here's my version: a
script i made to remove space (and other chars i dont like) from all files
in the current dir:
ls -1A > /tmp/desp.tmp
while read line
do
new=`echo -n "$line" | tr [:space:] _ | tr -d 
[=\(=][=\)=][=]=][=[=][=!=][=\'=][=,=][=?=] | tr [:upper:] [:lower:]`
if [ "$new" = "$line" ] ; then
         continue
fi
mv -i -- "$line" "$new"
done < /tmp/desp.tmp
rm /tmp/desp.tmp



>>At 09:26 AM 02/13/2004, rich+ml@lclogic.com wrote:
>>>Works for me, however I did forget to quote $x in original example.
>>
>>That would do it.
>>for x in *; do mv "$x" ${x// /}; done
>>removes the spaces, but only works in bash 2. :(
>>
>>
>>-
>>To unsubscribe from this list: send the line "unsubscribe linux-admin" in
>>the body of a message to majordomo@vger.kernel.org
>>More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 26+ messages in thread
* Stupid spaces
@ 2004-02-12 21:08 Scott Taylor
  2004-02-12 21:23 ` Alok K. Dhir
                   ` (5 more replies)
  0 siblings, 6 replies; 26+ messages in thread
From: Scott Taylor @ 2004-02-12 21:08 UTC (permalink / raw)
  To: linux-admin

Hello all,

I've done this before, but so long ago I can't find it again.  I have a 
bunch of files with spaces in them and I want to rename them with the 
spaces removed.

I have a rename command that came with RH7.2 but doesn't do the job
rename 's/\ //g' *
does nothing in bash

So I wrote a script many moons ago to do this but I can't remember which 
server it was on, let alone how I did it.  Something with tr and mv methinks.

anyone?


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2004-07-21  7:11 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-19 13:29 Stupid spaces calin
2004-07-19 13:56 ` Chris DiTrani
2004-07-19 14:59   ` calin
2004-07-19 14:45 ` Scott Taylor
2004-07-19 14:52   ` Scott Taylor
2004-07-20 17:48 ` scohen
2004-07-20 18:22   ` Adam Lang
2004-07-20 17:55 ` scohen
2004-07-20 18:20   ` Chris DiTrani
2004-07-20 18:37     ` Adam Lang
2004-07-21  2:28 ` Glynn Clements
2004-07-21  7:11   ` calin
  -- strict thread matches above, loose matches on Subject: below --
2004-02-13 19:13 urgrue
2004-02-12 21:08 Scott Taylor
2004-02-12 21:23 ` Alok K. Dhir
2004-02-12 22:19   ` Scott Taylor
2004-02-12 21:39 ` Yu Chen
2004-02-12 22:18   ` Scott Taylor
2004-02-13  2:15 ` rich+ml
2004-02-13  4:07 ` Emiliano Castagnari
2004-02-13 16:56   ` Scott Taylor
2004-02-13  6:51 ` Agus Budy Wuysang
2004-02-13 17:15   ` Scott Taylor
     [not found] ` <Pine.LNX.4.44.0402121811240.3031-100000@deadrat.localdomai n>
2004-02-13 16:33   ` Scott Taylor
2004-02-13 17:26     ` rich+ml
     [not found]     ` <Pine.LNX.4.44.0402130907370.3031-100000@deadrat.localdomai n>
2004-02-13 17:33       ` Scott Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).