- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2022 07:28 AM
Hello everyone,
I've created by error a DBFS folder named : ${env]
But when I run this command :
dbutils.fs.rm("/mnt/${env]")
It returns me this error :
java.net.URISyntaxException: Illegal character in path at index 12: /mnt/$%7Benv]
How can I do please ?
Thanks.
- Labels:
-
DBFS
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 03:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2022 11:13 PM
hi @Salah K. what command you used to create the folder name $[env] ?
If you have used dbutils, it would have failed to create a folder with this name. You would have got the error "Illegal character in path".
Please do `%fs ls /mnt` and check if the created folder exists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 01:26 AM
Hi,
Here is the result of of the "ls" command :
path name size modificationTime
dbfs:/mnt/${env]/ ${env]/ 0 1654780637000
dbfs:/mnt/Temp/ Temp/ 0 1643299456000
dbfs:/mnt/bronze/ bronze/ 0 1655217261000
dbfs:/mnt/dev/ dev/ 0 1642150158000
dbfs:/mnt/extprd/ extprd/ 0 0
dbfs:/mnt/gold/ gold/ 0 1655197511000
dbfs:/mnt/prod/ prod/ 0 1649774080000
dbfs:/mnt/qa/ qa/ 0 1643122331000
dbfs:/mnt/silver/ silver/ 0 1654676963000
dbfs:/mnt/uat/ uat/ 0 1642150009000
I've used this command to create the folder :
CREATE OR REPLACE TABLE ${env}XXXXX.ZZZZ (
.....
)
USING DELTA
OPTIONS (PATH '/mnt/${env]/gold/XXXXX/ZZZZ/')
As you can see, I've written "${env]" instead of "${env}'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 03:31 AM
Hello @Salah K.
Can you try below?
%sh rm -r /dbfs/mnt/$\{env\]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 04:34 AM
Thank you it works !!

