Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Solution to apostrophes within filenames used in shell commands? #938

@HaveAGitGat

Description

@HaveAGitGat

Node version (or tell us if you're using electron or some other framework):

v10.15.3

ShellJS version (the most recent version/Github branch you see the bug on):

"shelljs": "^0.8.3",

Operating system:

Windows 10

Description of the bug:

Apostrophes in filenames causing this error:
Syntax Error "(" unexpected

Example ShellJS command to reproduce the error:

nice -n 10 HandBrakeCLI -i '/home/haveagitgat/Desktop/Input/Test's.mp4' -o '/home/haveagitgat/Desktop/Output/Test's.mp4' -Z "Very Fast 1080p30

I've tried using double quotes around the file names but then I get errors when filenames contain special characters such as '$'.

References:
HaveAGitGat/HBBatchBeast#21
HaveAGitGat/HBBatchBeast#32

Any solutions without having to rename the files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    execIssues specific to the shell.exec() API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions