# Filenames with weird characters in them

**URL:** <https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646>\
**Category:** General\
**Created:** [25 February 2021 20:59 UTC](https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646 "2021-02-25T20:59:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 February 2021 20:59 UTC](https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646/1 "2021-02-25T20:59:03Z")

</div>

This is the important part of the code/flow:

(Need `fs-ops-move` node)

```auto
[{"id":"11f8a8d.dd42957","type":"function","z":"26262ba1.62dcbc","g":"c73138f5.6f42f","name":"build msg","func":"msg.spath = \"/home/me/.node-red/public/\";\nmsg.dpath = \"/home/me/.node-red/public/history/\";\n\nmsg.payload = \"Powered on at \" + msg.payload + \".db\";\nnode.status(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":4700,"y":240,"wires":[["ad90ee9d.430698"]]},{"id":"ad90ee9d.430698","type":"fs-ops-move","z":"26262ba1.62dcbc","g":"c73138f5.6f42f","name":"","sourcePath":"spath","sourcePathType":"msg","sourceFilename":"uptime.txt","sourceFilenameType":"str","destPath":"dpath","destPathType":"msg","destFilename":"payload","destFilenameType":"msg","link":false,"x":4850,"y":240,"wires":[[]]}]

```

So why is it generating files like this:

 ![Screenshot from 2021-02-26 07-57-31](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f1c961dfb51b1b77e69dfac52eda724d40f88f10.png)

All the `'` at the start and end of the names.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [25 February 2021 21:07 UTC](https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646/2 "2021-02-25T21:07:17Z")

</div>

> All the `'` at the start and end of the names.

and at the end.

Actually, i found this myself as well, got frustrated, thought something was wrong with my scripts causing these quotes, but no, apparently it is caused by the shell itself, there is some setting (quote styling) that has been turned on in GNU utils by default since some version.

If you use: `ls --quoting-style=literal` you will see that the quotes disappear,

edit - i just see that you use some 'exotic' `lf` commands (never heard of this), this could also be the cause for the default use of quotes.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 February 2021 21:09 UTC](https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646/3 "2021-02-25T21:09:31Z")

</div>

Ah, sorry, the `lf` is only my way (lazy) way of doing a specific `ls` command.

I have a few to do specific things rather than remembering to type all the qualifiers.

But thanks.

I'm not going mad. (I probably already am, so.....)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [25 February 2021 21:11 UTC](https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646/4 "2021-02-25T21:11:30Z")

</div>

ok in that case you can do:

```auto
cd 
nano .bashrc

```

add this at the bottom:

```auto
export QUOTING_STYLE=literal

```

ctrl+x y to save  
exit the terminal and start a new connection, then it should be gone.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 February 2021 21:12 UTC](https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646/5 "2021-02-25T21:12:42Z")

</div>

I edited my `.bash_alias` file to have this line now.

`alias lf='ls -F --group-directories-first --quoting-style=literal'`

Works like a charm.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 February 2021 21:13 UTC](https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646/6 "2021-02-25T21:13:15Z")

</div>

I guess that would work too.

I may go that way actually.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 February 2021 21:31 UTC](https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646/7 "2021-02-25T21:31:06Z")

</div>

> [@Trying\_to\_learn](#):
>
> So why is it generating files like this:

The quotes are because the filename includes spaces. When entering filenames with spaces you have to quote the name (or escape the spaces) and the default with `ls` is to do the same. If they were not quoted you might think you have a file called `Powered` and another call `on`. I know it is obvious in the case you show, but might not be in other cases, particularly if you started adding mulitple spaces. Suppose for example the directory contained just one file called  
`Powered on at 2021-02-212108.db Powered on at ....`  
Without the quotes it is unclear whether there is one file or two.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 February 2021 21:33 UTC](https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646/8 "2021-02-25T21:33:05Z")

</div>

Appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 March 2021 21:33 UTC](https://discourse.nodered.org/t/filenames-with-weird-characters-in-them/41646/9 "2021-03-11T21:33:27Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
