Using MKDIR via shell script [closed]

-1

I'm trying to create a directory via shell script, using the command:

mkdir -m755 "/var/www/app.dominio.com/html/$1"

Where the folder name is passed by parameter, you are getting a question mark "folder_name?" at the end and it is inaccessible, what should I do to make it correctly created?

    
asked by anonymous 17.08.2018 / 03:00

2 answers

1

As you have not gone through any more details ( the tests you've done, or your script ), I might end up suggesting something you already did.

In the script using your example ), you use:

mkdir -m755 "/var/www/app.dominio.com/html/$1" ( exactly as you are doing )

And in the script call ( which is most important ), you do:

$ ./meu_querido_script nome_da_pasta

If this does not work, check the permissions on the directory, or put your full script (if available).

obs: I performed the tests exactly as I quoted and it worked, if it does not work we can continue the discussion.     

17.08.2018 / 03:43
0

After several attempts I discovered that the problem was due to the fact that I created the script in windows because it puts a different line break character than the one accepted in linux.

    
17.08.2018 / 22:02