Re: tmpfiles.d and spaces in filenames



On 06/01/11 14:15, Patrick O'Callaghan wrote:
On Wed, 2011-06-01 at 13:48 -0700, JD wrote:
On 06/01/11 12:39, Patrick O'Callaghan wrote:
On Wed, 2011-06-01 at 12:18 -0700, JD wrote:
The quotes are not optional.
Read my message again.

poc

Did you read my samples of "use" ?
Did you see the difference when the quotes
were used and when the quotes were not?
Of course I did. You're simply repeating what I said and you seem not to
have read carefully. Once again: the quotes are necessary in the use of
the variable.

I also mentioned that in the specific application of "echo" as used in
your example it didn't make much difference, though as Ian Malone has
pointed out there is the case of multiple spaces in the name being
collapsed to one. That's technically correct but it's a distinction
without a difference for the example input you give*. I'm sorry I even
brought it up if it's causing so much confusion.

poc

Well here's what you said:

No, each filename counts as one argument, even if it has spaces in it.
The problem arises when you*use* the argument. The above should read:

for i in *; do
[ -f "$i"]&& echo "$i" is a file
done

(the quotes are optional in the echo case obviously).


Should have chosen a "use" other than echo :)

but I did indeed misread your post.

Cheers,

JD
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines



Relevant Pages

  • Re: tmpfiles.d and spaces in filenames
    ... Did you see the difference when the quotes ... That's technically correct but it's a distinction ...
    (Fedora)
  • Re: tmpfiles.d and spaces in filenames
    ... Did you see the difference when the quotes ... To unsubscribe or change subscription options: ... Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines ...
    (Fedora)
  • Re: its not the school home work
    ... I've learned a bit about strong quotes and think I realized when to ... the shell (such as in the $var, but also for the spaces (that ... echo "foo bar" ... you may say that $string does not appear in /list/ context so ...
    (comp.unix.shell)
  • Re: heredoc and array problems
    ... You need to look up Interpolation. ... When you echo an array variable such as $Din SINGLE QUOTES ...
    (comp.lang.php)
  • Re: Fascinating problem with bash
    ... will result in OTHER_VAR being unset at the completion of the loop. ... subshell exits and any vars it sets will go away with it. ... The author uses double quotes for the subshell, ... first echo, to force variable substitution to happen when the loop is ...
    (Debian-User)