pan-users
[Top][All Lists]
Advanced

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

Re: [Pan-users] 0.11.3 question


From: Jeff Vian
Subject: Re: [Pan-users] 0.11.3 question
Date: Tue, 03 Jun 2003 12:05:58 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830

You are correct in some cases about the quotes.

However, if the filename contains spaces (or any other non-printable character) the quotes would be required. The syntax with the quotes will work in all cases, but without the quotes will only work in some cases.

The squiggly braces is the correct syntax for a universal command using variable names as well. For example, if you have 2 variables ( b and bb ) then using $bb may not get what you want. If I wanted to have the contents of $b appended with a literal b I could NOT guartantee to do it without the use of the squiggly braces. ${b}b would give the results I wanted, but the system may in some cases chose to do that OR instead use the contents of bb if I use $bb. $bb will ALWAYS match $b, then have to check again to see if there is another it matches ($bb) However, ${bb} will ONLY match variable bb and NEVER match variable b.

Please read up on the shell special characters before you make a blanket statement that "they are not needed".

I have downloaded some music files that have spaces in the name, and when I wanted to remove the spaces I had to devise a way to use the actual original filename with the looping features of the shell to automaticlaly change all filenames in the directory. The quotes were required to do it correctly since the quotes change the space from a special delimiter to an actual character.

Eric Ortega wrote:

On Fri, May 23, 2003 at 08:23:49PM -0400, Wolf J. Flywheel wrote:

As far as I know, there's no way built into Pan, but if you're using Bash as your command shell, you can save them all in the same place and do something like this:

for f in *.jpg ; do mv "${f}" "BobsCat${f}" ; done

Those quotes and squiggly-brackets are unnecessary AFAIK.

 for i in `ls *.jpg` ; do mv $i BobsCat$i; done

is fine.


_______________________________________________
Pan-users mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/pan-users







reply via email to

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