小编tar*_*ran的帖子

编辑 .bashrc 后出现“意外标记附近的语法错误”

我正在尝试访问剪贴板,但是当我source ~/.bashrc 在终端中输入时出现此错误:

bash: /home/taran/.bashrc: line 2: syntax error near unexpected token ('
bash: /home/taran/.bashrc: line 2:alias pbpaste='xclip -selection 
clipboard -o'# ~/.bashrc: executed by bash(1) for non-login shells
Run Code Online (Sandbox Code Playgroud)

我尝试在Gary Woodfine's answer to Command Line Clipboard Access 中做教程。

的输出cat ~/.bashrc是:

alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- …
Run Code Online (Sandbox Code Playgroud)

command-line bash alias bashrc

11
推荐指数
2
解决办法
1万
查看次数

标签 统计

alias ×1

bash ×1

bashrc ×1

command-line ×1