LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices


Reply
  Search this Thread
Old 02-22-2017, 02:40 AM   #1
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Rep: Reputation: 28
Syntax errors when starting bash


Hi,
I'm getting bash related syntax errors. They started after an 'apt-get upgrade' recently. In the past I could go for months without the errors and then they would start appearing again.

I get them when I start an emacs shell buffer, and when I try to make a new kernel.
Code:
/bin/bash: _parse_usage: line 16: syntax error near unexpected token `('
/bin/bash: _parse_usage: line 16: ` -?(\[)+([a-zA-Z0-9?]))'
/bin/bash: error importing function definition for `_parse_usage'
/bin/bash: _longopt: line 14: syntax error near unexpected token `('
/bin/bash: _longopt: line 14: ` --+([-a-z0-9_]))'
/bin/bash: error importing function definition for `_longopt'
How can I stop them?

Thanks
Jim
 
Old 02-22-2017, 04:29 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Which version of Mint are you running?

Because you mentioned that the problem arose after a recent apt-get upgrade (we can check the logs later), we should check that side of things first.

So, could you please paste the output from:

inxi -r (if inxi isn't installed, please install it using sudo apt-get install inxi).

sudo apt-get update

sudo apt-get upgrade
 
Old 02-22-2017, 11:08 PM   #3
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
I'm currently using 18.0, but the problem has occurred with other versions and distros based on Ubuntu.
Code:
root@HP / # inxi -r
bash: _parse_usage: line 16: syntax error near unexpected token `('
bash: _parse_usage: line 16: ` -?(\[)+([a-zA-Z0-9?]))'
bash: error importing function definition for `_parse_usage'
bash: _longopt: line 14: syntax error near unexpected token `('
bash: _longopt: line 14: ` --+([-a-z0-9_]))'
bash: error importing function definition for `_longopt'
Repos:     Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http://packages.linuxmint.com sarah main upstream import backport #id:linuxmint_main
           deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ xenial partner
           Active apt sources in file: /etc/apt/sources.list.d/ubuntu-defaults.list
           deb http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu xenial main
root@HP-JEH / # apt-get update
Hit:1 http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu xenial InRelease
Ign:2 http://packages.linuxmint.com sarah InRelease
Hit:3 http://archive.canonical.com/ubuntu xenial InRelease
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:5 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:6 http://packages.linuxmint.com sarah Release
Get:8 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [219 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:11 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages [211 kB]
Get:12 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [78.6 kB]
Get:13 http://security.ubuntu.com/ubuntu xenial-security/universe i386 Packages [73.5 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [478 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [469 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [188 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [403 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [397 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [151 kB]
Fetched 2,973 kB in 8s (337 kB/s)
Reading package lists... Done
root@HP / # apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  dconf-cli libgexiv2-2 libunity-protocol-private0
  libunity-scopes-json-def-desktop libunity9 oxygen5-icon-theme
  qtdeclarative5-xmllistmodel-plugin
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  gstreamer1.0-libav imagemagick imagemagick-6.q16 imagemagick-common
  libmagickcore-6.q16-2 libmagickcore-6.q16-2-extra libmagickwand-6.q16-2
  libpq5 linux-libc-dev nano tcpdump xserver-xorg-video-amdgpu
12 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
Need to get 4,024 kB of archives.
After this operation, 9,216 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libmagickwand-6.q16-2 amd64 8:6.8.9.9-7ubuntu5.4 [288 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libmagickcore-6.q16-2 amd64 8:6.8.9.9-7ubuntu5.4 [1,573 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 imagemagick-common all 8:6.8.9.9-7ubuntu5.4 [41.5 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 nano amd64 2.5.3-2ubuntu2 [191 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 tcpdump amd64 4.9.0-1ubuntu1~ubuntu16.04.1 [382 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 gstreamer1.0-libav amd64 1.8.3-1ubuntu0.2 [92.5 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 imagemagick amd64 8:6.8.9.9-7ubuntu5.4 [44.9 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 imagemagick-6.q16 amd64 8:6.8.9.9-7ubuntu5.4 [387 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libmagickcore-6.q16-2-extra amd64 8:6.8.9.9-7ubuntu5.4 [59.4 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpq5 amd64 9.5.6-0ubuntu0.16.04 [78.2 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-libc-dev amd64 4.4.0-64.85 [834 kB]
Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 xserver-xorg-video-amdgpu amd64 1.1.2-0ubuntu0.16.04.1 [52.6 kB]
Fetched 4,024 kB in 9s (444 kB/s)
debconf: unable to initialise frontend: Dialog
debconf: (Dialogue frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
(Reading database ... 244370 files and directories currently installed.)
Preparing to unpack .../libmagickwand-6.q16-2_8%3a6.8.9.9-7ubuntu5.4_amd64.deb ...
Unpacking libmagickwand-6.q16-2:amd64 (8:6.8.9.9-7ubuntu5.4) over (8:6.8.9.9-7ubuntu5.3) ...
Preparing to unpack .../libmagickcore-6.q16-2_8%3a6.8.9.9-7ubuntu5.4_amd64.deb ...
Unpacking libmagickcore-6.q16-2:amd64 (8:6.8.9.9-7ubuntu5.4) over (8:6.8.9.9-7ubuntu5.3) ...
Preparing to unpack .../imagemagick-common_8%3a6.8.9.9-7ubuntu5.4_all.deb ...
Unpacking imagemagick-common (8:6.8.9.9-7ubuntu5.4) over (8:6.8.9.9-7ubuntu5.3) ...
Preparing to unpack .../nano_2.5.3-2ubuntu2_amd64.deb ...
Unpacking nano (2.5.3-2ubuntu2) over (2.5.3-2ubuntu1) ...
Preparing to unpack .../tcpdump_4.9.0-1ubuntu1~ubuntu16.04.1_amd64.deb ...
Unpacking tcpdump (4.9.0-1ubuntu1~ubuntu16.04.1) over (4.7.4-1ubuntu1) ...
Preparing to unpack .../gstreamer1.0-libav_1.8.3-1ubuntu0.2_amd64.deb ...
Unpacking gstreamer1.0-libav:amd64 (1.8.3-1ubuntu0.2) over (1.8.3-1ubuntu0.1) ...
Preparing to unpack .../imagemagick_8%3a6.8.9.9-7ubuntu5.4_amd64.deb ...
Unpacking imagemagick (8:6.8.9.9-7ubuntu5.4) over (8:6.8.9.9-7ubuntu5.3) ...
Preparing to unpack .../imagemagick-6.q16_8%3a6.8.9.9-7ubuntu5.4_amd64.deb ...
Unpacking imagemagick-6.q16 (8:6.8.9.9-7ubuntu5.4) over (8:6.8.9.9-7ubuntu5.3) ...
Preparing to unpack .../libmagickcore-6.q16-2-extra_8%3a6.8.9.9-7ubuntu5.4_amd64.deb ...
Unpacking libmagickcore-6.q16-2-extra:amd64 (8:6.8.9.9-7ubuntu5.4) over (8:6.8.9.9-7ubuntu5.3) ...
Preparing to unpack .../libpq5_9.5.6-0ubuntu0.16.04_amd64.deb ...
Unpacking libpq5:amd64 (9.5.6-0ubuntu0.16.04) over (9.5.5-0ubuntu0.16.04) ...
Preparing to unpack .../linux-libc-dev_4.4.0-64.85_amd64.deb ...
Unpacking linux-libc-dev:amd64 (4.4.0-64.85) over (4.4.0-62.83) ...
Preparing to unpack .../xserver-xorg-video-amdgpu_1.1.2-0ubuntu0.16.04.1_amd64.deb ...
Unpacking xserver-xorg-video-amdgpu (1.1.2-0ubuntu0.16.04.1) over (1.1.0-1) ...
Processing triggers for libc-bin (2.23-0ubuntu5) ...
Processing triggers for install-info (6.1.0.dfsg.1-5) ...
Processing triggers for doc-base (0.10.7) ...
Processing 2 changed doc-base files...
Registering documents with scrollkeeper...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Setting up imagemagick-common (8:6.8.9.9-7ubuntu5.4) ...
Setting up libmagickcore-6.q16-2:amd64 (8:6.8.9.9-7ubuntu5.4) ...
Setting up libmagickwand-6.q16-2:amd64 (8:6.8.9.9-7ubuntu5.4) ...
Setting up nano (2.5.3-2ubuntu2) ...
Setting up tcpdump (4.9.0-1ubuntu1~ubuntu16.04.1) ...
Installing new version of config file /etc/apparmor.d/usr.sbin.tcpdump ...
Setting up gstreamer1.0-libav:amd64 (1.8.3-1ubuntu0.2) ...
Setting up imagemagick-6.q16 (8:6.8.9.9-7ubuntu5.4) ...
Setting up imagemagick (8:6.8.9.9-7ubuntu5.4) ...
Setting up libmagickcore-6.q16-2-extra:amd64 (8:6.8.9.9-7ubuntu5.4) ...
Setting up libpq5:amd64 (9.5.6-0ubuntu0.16.04) ...
Setting up linux-libc-dev:amd64 (4.4.0-64.85) ...
Setting up xserver-xorg-video-amdgpu (1.1.2-0ubuntu0.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu5) ...
root@HP / #
 
Old 03-07-2017, 04:20 AM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Sorry for taking a while to get back to you.

Could you please post the contents of your .bashrc file. Have you edited that file at any point?
 
Old 03-07-2017, 08:09 PM   #5
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
I've just uninstalled bash-completion and the problem is gone. Now I get a message complaining bash-completion is missing...
 
Old 03-08-2017, 04:54 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by CollieJim View Post
I've just uninstalled bash-completion and the problem is gone. Now I get a message complaining bash-completion is missing...
Out of interest, why did you do that? And why didn't you post the contents of your .bashrc file?
 
Old 03-09-2017, 12:12 AM   #7
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
In other Ubuntu/Ubuntu-based distros bash-completion appears to be entirely in bash.bashrc, but in LinuxMint it's a package. Due to the number of complex regular expressions in it I tried removing it to see if would work. It did, and answered my question. As for not including bash.bashrc, I was on my Raspberry Pi while my main system was being backed up (full disk clone). I should have waited.
Code:
~ $ cat /etc/bash.bashrc
# System-wide .bashrc file for interactive bash(1) shells.

# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '

# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
#    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
#    ;;
#*)
#    ;;
#esac

# enable bash completion in interactive shells
#if ! shopt -oq posix; then
#  if [ -f /usr/share/bash-completion/bash_completion ]; then
#    . /usr/share/bash-completion/bash_completion
#  elif [ -f /etc/bash_completion ]; then
#    . /etc/bash_completion
#  fi
#fi
                                                                                                               
# if the command-not-found package is installed, use it                                                        
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then                
        function command_not_found_handle {                                                                    
                # check because c-n-f could've been removed in the meantime                                    
                if [ -x /usr/lib/command-not-found ]; then                                                     
                   /usr/lib/command-not-found -- "$1"                                                          
                   return $?                                                                                   
                elif [ -x /usr/share/command-not-found/command-not-found ]; then                               
                   /usr/share/command-not-found/command-not-found -- "$1"                                      
                   return $?                                                                                   
                else                                                                                           
                   printf "%s: command not found\n" "$1" >&2                                                   
                   return 127                                                                                  
                fi                                                                                             
        }                                                                                                      
fi
 
Old 03-09-2017, 01:32 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
bash without bash completion?
a sad experience.

maybe re-installing bash-completion would've been enough?
i'm sure the problem can be fixed instead of avoided, but it's up to you of course.
 
Old 03-09-2017, 04:18 AM   #9
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
That looks fine, CollieJim. Could you also paste your ~/.bashrc? It will probably be good too, but worthwhile checking.

As ondoho suggested, have you tried purging and then reinstalling bash-completion to see if that package's previous config was to blame?
 
Old 03-11-2017, 10:14 AM   #10
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
The problem returned when bash-completion was reinstalled.
Here is my .bashrc, with no problem, followed by /root/.bashrc, which does have the problem. I have not modified either.

~/.bashrc:
Code:
~ $ cat .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# Source global definitions
if [ -f /etc/bash.bashrc ]; then
        . /etc/bash.bashrc
fi

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"


# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi


# mint-fortune
/usr/bin/mint-fortune
/root/.bashrc:
Code:
/ # cat ~/.bashrc
# ~/.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 $- in
    *i*) ;;
      *) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm|xterm-color|*-256color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
	# We have color support; assume it's compliant with Ecma-48
	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
	# a case would tend to support setf rather than setaf.)
	color_prompt=yes
    else
	color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    if [[ ${EUID} == 0 ]] ; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
    else
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '
    fi
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

if [ -x /usr/bin/mint-fortune ]; then
     /usr/bin/mint-fortune
fi
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax errors from mysqldump said76 Linux - Server 2 05-25-2013 02:52 AM
syntax errors connect2janu Programming 1 04-09-2012 07:11 PM
bash Arithmetic Syntax Errors MTK358 Programming 23 08-15-2011 11:04 AM
MySQL not starting, wrong syntax??? riscphree Linux - Software 2 12-21-2005 08:13 PM
couple C++ syntax errors bru Programming 8 05-16-2004 05:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint

All times are GMT -5. The time now is 02:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration