#TIL: You can't save a spreadsheet in the "Save as" dialog in #LibreOffice whose file name contains an asterisk ("*"). You don't get any error message nor an greyed out "Save" button. It just does nothing, even though the originally opened file has that asterisk in the name. Escaping via backslash also doesn't work. 🀬 🀌

.oO( What happens when seasoned Unix #CLI users with strong experience in quoting and escaping try out a #GUI program… )

@xtaran This is fascinating. It would never occur to me put an * in a file name because those are wildcards.
@OrionKidder: In Unix any character except slash and a nullbyte are valid for file names. πŸ˜‡ Depending on your application (or shell) you might need some quoting or escaping. 😁 Applications which don't support that (or escaping or quoting) are buggy.
@xtaran Interesting! The last time I had *any* command-line skills was the 90s in DOS, so I'm way behind.

@OrionKidder: And I gave talks about Unix shell quoting and escaping (and the three levels of quoting) lastβ€”oh, no, that's wrongβ€”penultimate decade: https://noone.org/talks/quoting/

My talks and slides were in German, though, and are based on https://people.mpi-inf.mpg.de/~uwe/lehre/unixffb/quoting-guide.html (this time English) whose origins are even older as I learned of it in a seminar during studies (late 90s) quoting that guide. πŸ§”β€β™‚οΈπŸ€“ πŸ‘΄

Shell-Quoting verstehen

@xtaran Any decent filename contains at least spaces, tabs, asterisks, colons and slashes. Programs meddling against them are buggy.
@js: Slashes only work on Macs and Windows. Backslashes are fine on Unix, though.
@js @xtaran All those are no big thing. Now, file names with newlines in it, that's a proper grownup file name.

@madalex @js: My favourite file name for a file to delete is:

-rf <Ctrl-C>

Because it requires every level of #quoting:

* Application level quoting by prefixing the file name with ./ so that rm doesn't take -rf as option.
* Shell quoting by #escaping or quoting the blank.
* Input level quoting by pressing usually <Ctrl-V> (Emacsish: <Ctrl-Q>) before <Ctrl-C> to be able to enter a literal <Ctrl-C>.

(That's something you just don't unlearn once it's in your brain. πŸ€“ )

#CLI #Bash #Zsh #Shell

@xtaran @js @madalex @leyrer OR, you just mc, go to that file and F8 😼😽
@leyrer @madalex @js @xtaran and once you know the ./ part, rm ./-<Tab> in mksh will also DTRT πŸ˜½β˜•οΈ

@leyrer @madalex @xtaran @js for extra evil (for tools that output the filename) add some colour codes.

One Tab and one newline in the filebame exercise different parts of brokenness and ought to also be included, as well as two UCS characters whose NFC and NFD differs, one of them in NFC, one in NFD, to break Apple, and a colon and a backslash to break Windows, and an upper-case character that you lowercase in an otherwise identical filename to break both.

@xtaran @js @leyrer @madalex oh and one \xFE to break UCS filesystems and programs who expect filenames to be strict UTF-8.
@mirabilos @leyrer @xtaran @js Just as a PSA: even though you can put all those fancy characters into an file name, it's not a great idea to do so if you want them included in your company backup. Most if not all of the enterprise backup software simply throws an error when encountering anything which isn't strictly ASCII and moves on to the next file.
@leyrer @mirabilos @xtaran @js I know. real men don't back up their data.
@madalex @leyrer @mirabilos @js: They just upload it to FTP and let the world mirror it? πŸ€ͺ
@madalex @mirabilos @xtaran @js I also like to use
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*.docx
@leyrer @madalex @mirabilos @xtaran @js I assume extra content inside the docx zip-archive is left as-is for most parsers, so one could craft an EICAR inside a valid docx...that might lead to some interesting outcomes. PDF has attachment features too πŸ€”
@jonas @leyrer @madalex @xtaran @js just make sure to not compress the attached file in the PDF (qpdf may help).
@jonas @leyrer @madalex @mirabilos @xtaran @js
always remember to actually attach the item when you write "see attached"...

@madalex @mirabilos @leyrer @xtaran @js
"That's what she said!"

(disclosure: ich hab schon mal ein Backup geschrottet mit 'seltsamen' Dateinamen, und es waren nicht meine)

@lobingera @madalex @mirabilos @leyrer @js: That reminds me of a story that happened to @df7cb in the late 90s:

His account was the most recent one created on a host. He created a symbolic link named index.html in his public_html directory pointing to /dev/null. Backup was done using tar. tar back then had a bug when applying ownership and permissions to symlinks in the archive. So after restoring a backup, only two users were still able to work: He and root. Because he owned /dev/null. πŸ€ͺ

@xtaran @lobingera @madalex @leyrer @js @df7cb that’s assuming you can even set them; AFAICT, on BSD, symlinks’ permission bits, uid and gid are ignored(?), except for operations on the symlink itself, where the uid and gid come into play.
@mirabilos @lobingera @madalex @leyrer @js: Might have been SunOS 4. @df7cb probably remembers better.
@xtaran @lobingera @madalex @leyrer @js @df7cb nah, I can easily believe someone forgot to exclude symlinks from permission restores
@xtaran @lobingera @madalex @mirabilos @leyrer @js the symlink to /dev/null was this dreaded lock file in .netscape
@madalex @mirabilos @leyrer @js: So we have a buggy backup system? πŸ˜‡

@xtaran

I'll leave it to you to talk to Daniele about that fine product we've got and why it is the best there is.

On the other hand, I still recognize everything from the early nineties when it was still called ADSM and probably was state of the art - at least back then.

@mirabilos @leyrer @js

@xtaran I can remember of Samba versions wich allows filenames containig '/'. Deleting a file named aaa/bbb was a great fun...

@dolorosus: This sounds like some Mac compatibility as IIRC MacOS 9 and older used colons (":") as directory delimiter and hence allowed slashes ("/") as part of the file name.

MacOS X and later IIRC converts that back and forth in the GUI, displays colons in file names as slashes inside the GUI (and only there).