Skip to main content

The second quote sign break the command.

When I run:

abc="ls -l '/home/wattana/Desktop'"
$abc

It gave me an error.

But when I run

abc="ls -l /home/wattana/Desktop"
$abc

There is no error at all

There is no way to fix this at the time(for me) but you can avoid the error buyby not having space in directory name.

This answer answer said said the eval command can be used to fix this but it doesn't work for me :(

The second quote sign break the command.

When I run:

abc="ls -l '/home/wattana/Desktop'"
$abc

It gave me an error.

But when I run

abc="ls -l /home/wattana/Desktop"
$abc

There is no error at all

There is no way to fix this at the time(for me) but you can avoid the error buy not having space in directory name.

This answer said the eval command can be used to fix this but it doesn't work for me :(

The second quote sign break the command.

When I run:

abc="ls -l '/home/wattana/Desktop'"
$abc

It gave me an error.

But when I run

abc="ls -l /home/wattana/Desktop"
$abc

There is no error at all

There is no way to fix this at the time(for me) but you can avoid the error by not having space in directory name.

This answer said the eval command can be used to fix this but it doesn't work for me :(

Source Link

The second quote sign break the command.

When I run:

abc="ls -l '/home/wattana/Desktop'"
$abc

It gave me an error.

But when I run

abc="ls -l /home/wattana/Desktop"
$abc

There is no error at all

There is no way to fix this at the time(for me) but you can avoid the error buy not having space in directory name.

This answer said the eval command can be used to fix this but it doesn't work for me :(