D
D
DimiDr0lik2015-07-03 17:18:20
linux
DimiDr0lik, 2015-07-03 17:18:20

How to create folder\file named current date?

when creating a folder from the command line with the mkdir -p /mnt/YaDisk/`date +%d-%m-%Y` command, everything is created normally, but when using the command in a script, "??" appear at the end of the folder. how to remove them?
foldername=`date +%d-%m-%Y`
mkdir -p /mnt/YaDisk/$foldername

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrew, 2015-07-04
@DimiDr0lik

As Andrei Burov correctly noted , you most likely have an incorrect line ending. That is, the script is obviously written in win encoding. For example, you wrote it in notepad and uploaded it to *nix server. Or some other artifacts .. Although, taking into account the quotes, the line break should not affect. What program did you use to save the script? Encoding? Copy the entire script here.

Y
Yuri, 2015-07-03
@xtreme

What shell is used in the script?

A
Andrey Burov, 2015-07-03
@BuriK666

maybe \r\n hyphens?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question