Bad : modifier in $ (.)

2019-03-18 03:08发布

I want to set environment variable in linux and did the same by giving command

 export PATH=$PATH:.

But getting error Bad : modifier in $ (.).

Can some one help this. I tried with bash shell and ksh

标签: linux shell unix
3条回答
看我几分像从前
2楼-- · 2019-03-18 03:13

Dont forget to escape the colon

setenv PYTHONPATH $PYTHONPATH\:/disk1/mypath
查看更多
小情绪 Triste *
3楼-- · 2019-03-18 03:24

You might want to try this:

export PATH="${PATH}:."

I don't like having the current directory in the path, but at the end it's fairly safe.

查看更多
Juvenile、少年°
4楼-- · 2019-03-18 03:31
Bad : modifier in $ (.).

This is not a Bash error, nor is it from Ksh: it's from C-shell or one of its clones such as Tcsh.

You want:

setenv PATH ${PATH}:.

But you should not put . in your ${PATH}, it's a well-known security risk.

查看更多
登录 后发表回答