upgraded to Ubuntu 18.04 LTS and now there is error found when loading /home/[user]/.profile
up vote
2
down vote
favorite
My laptop used to have Ubuntu 16.04 LTS. I upgraded it to Ubuntu 18.04 LTS. After upgrading, every time I boot it, it shows this error message:
Error found when loading /home/[user]/.profile:
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
As a result the session will not be configured correctly.
When I click OK, the message disappears. When I open the terminal, this appears:
continue: only meaningful in 'for', 'while', or 'until' loop
continue: only meaningful in 'for', 'while', or 'until' loop
continue: only meaningful in 'for', 'while', or 'until' loop
I tried editing line 6 of helpers.bash and changed continue to return but the problem still persists. This is the code for helpers.bash:
# Helper function loading various enable-able files
function _load_bash_it_files() {
subdirectory="$1"
if [ ! -d "${BASH_IT}/${subdirectory}/enabled" ]
then
continue
fi
FILES="${BASH_IT}/${subdirectory}/enabled/*.bash"
for config_file in $FILES
do
if [ -e "${config_file}" ]; then
source $config_file
fi
done
}
# Function for reloading aliases
function reload_aliases() {
_load_bash_it_files "aliases"
}
# Function for reloading auto-completion
function reload_completion() {
_load_bash_it_files "completion"
}
# Function for reloading plugins
function reload_plugins() {
_load_bash_it_files "plugins"
}
bash-it ()
{
about 'bash-it help and maintenance'
param '1: verb [one of: help | show | enable | disable ]'
param '2: component type [one of: alias(es) | completion(s) | plugin(s) ]'
param '3: specific component [optional]'
example '$ bash-it show plugins'
example '$ bash-it help aliases'
example '$ bash-it enable plugin git'
example '$ bash-it disable alias hg'
typeset verb=${1:-}
shift
typeset component=${1:-}
shift
typeset func
case $verb in
show)
func=_bash-it-$component;;
enable)
func=_enable-$component;;
disable)
func=_disable-$component;;
help)
func=_help-$component;;
*)
reference bash-it
return;;
esac
# pluralize component if necessary
if ! _is_function $func; then
if _is_function ${func}s; then
func=${func}s
else
if _is_function ${func}es; then
func=${func}es
else
echo "oops! $component is not a valid option!"
reference bash-it
return
fi
fi
fi
$func $*
}
_is_function ()
{
_about 'sets $? to true if parameter is the name of a function'
_param '1: name of alleged function'
_group 'lib'
[ -n "$(LANG=C type -t $1 2>/dev/null | grep 'function')" ]
}
_bash-it-aliases ()
{
_about 'summarizes available bash_it aliases'
_group 'lib'
_bash-it-describe "aliases" "an" "alias" "Alias"
}
_bash-it-completions ()
{
_about 'summarizes available bash_it completions'
_group 'lib'
_bash-it-describe "completion" "a" "completion" "Completion"
}
_bash-it-plugins ()
{
_about 'summarizes available bash_it plugins'
_group 'lib'
_bash-it-describe "plugins" "a" "plugin" "Plugin"
}
_bash-it-describe ()
{
_about 'summarizes available bash_it components'
_param '1: subdirectory'
_param '2: preposition'
_param '3: file_type'
_param '4: column_header'
_example '$ _bash-it-describe "plugins" "a" "plugin" "Plugin"'
subdirectory="$1"
preposition="$2"
file_type="$3"
column_header="$4"
typeset f
typeset enabled
printf "%-20s%-10s%sn" "$column_header" 'Enabled?' 'Description'
for f in $BASH_IT/$subdirectory/available/*.bash
do
if [ -e $BASH_IT/$subdirectory/enabled/$(basename $f) ]; then
enabled='x'
else
enabled=' '
fi
printf "%-20s%-10s%sn" "$(basename $f | cut -d'.' -f1)" " [$enabled]" "$(cat $f | metafor about-$file_type)"
done
printf 'n%sn' "to enable $preposition $file_type, do:"
printf '%sn' "$ bash-it enable $file_type <$file_type name> -or- $ bash-it enable $file_type all"
printf 'n%sn' "to disable $preposition $file_type, do:"
printf '%sn' "$ bash-it disable $file_type <$file_type name> -or- $ bash-it disable $file_type all"
}
_disable-plugin ()
{
_about 'disables bash_it plugin'
_param '1: plugin name'
_example '$ disable-plugin rvm'
_group 'lib'
_disable-thing "plugins" "plugin" $1
}
_disable-alias ()
{
_about 'disables bash_it alias'
_param '1: alias name'
_example '$ disable-alias git'
_group 'lib'
_disable-thing "aliases" "alias" $1
}
_disable-completion ()
{
_about 'disables bash_it completion'
_param '1: completion name'
_example '$ disable-completion git'
_group 'lib'
_disable-thing "completion" "completion" $1
}
_disable-thing ()
{
_about 'disables a bash_it component'
_param '1: subdirectory'
_param '2: file_type'
_param '3: file_entity'
_example '$ _disable-thing "plugins" "plugin" "ssh"'
subdirectory="$1"
file_type="$2"
file_entity="$3"
if [ -z "$file_entity" ]; then
reference "disable-$file_type"
return
fi
if [ "$file_entity" = "all" ]; then
typeset f $file_type
for f in $BASH_IT/$subdirectory/available/*.bash
do
plugin=$(basename $f)
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
fi
done
else
typeset plugin=$(command ls $BASH_IT/$subdirectory/enabled/$file_entity.*bash 2>/dev/null | head -1)
if [ -z "$plugin" ]; then
printf '%sn' "sorry, that does not appear to be an enabled $file_type."
return
fi
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
fi
printf '%sn' "$file_entity disabled."
}
_enable-plugin ()
{
_about 'enables bash_it plugin'
_param '1: plugin name'
_example '$ enable-plugin rvm'
_group 'lib'
_enable-thing "plugins" "plugin" $1
}
_enable-alias ()
{
_about 'enables bash_it alias'
_param '1: alias name'
_example '$ enable-alias git'
_group 'lib'
_enable-thing "aliases" "alias" $1
}
_enable-completion ()
{
_about 'enables bash_it completion'
_param '1: completion name'
_example '$ enable-completion git'
_group 'lib'
_enable-thing "completion" "completion" $1
}
_enable-thing ()
{
cite _about _param _example
_about 'enables a bash_it component'
_param '1: subdirectory'
_param '2: file_type'
_param '3: file_entity'
_example '$ _enable-thing "plugins" "plugin" "ssh"'
subdirectory="$1"
file_type="$2"
file_entity="$3"
if [ -z "$file_entity" ]; then
reference "enable-$file_type"
return
fi
if [ "$file_entity" = "all" ]; then
typeset f $file_type
for f in $BASH_IT/$subdirectory/available/*.bash
do
plugin=$(basename $f)
if [ ! -h $BASH_IT/$subdirectory/enabled/$plugin ]; then
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
fi
done
else
typeset plugin=$(command ls $BASH_IT/$subdirectory/available/$file_entity.*bash 2>/dev/null | head -1)
if [ -z "$plugin" ]; then
printf '%sn' "sorry, that does not appear to be an available $file_type."
return
fi
plugin=$(basename $plugin)
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
printf '%sn' "$file_entity is already enabled."
return
fi
mkdir -p $BASH_IT/$subdirectory/enabled
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
fi
printf '%sn' "$file_entity enabled."
}
_help-completions()
{
_about 'summarize all completions available in bash-it'
_group 'lib'
_bash-it-completions
}
_help-aliases()
{
_about 'shows help for all aliases, or a specific alias group'
_param '1: optional alias group'
_example '$ alias-help'
_example '$ alias-help git'
if [ -n "$1" ]; then
cat $BASH_IT/aliases/available/$1.aliases.bash | metafor alias | sed "s/$/'/"
else
typeset f
for f in $BASH_IT/aliases/enabled/*
do
typeset file=$(basename $f)
printf 'nn%s:n' "${file%%.*}"
# metafor() strips trailing quotes, restore them with sed..
cat $f | metafor alias | sed "s/$/'/"
done
fi
}
_help-plugins()
{
_about 'summarize all functions defined by enabled bash-it plugins'
_group 'lib'
# display a brief progress message...
printf '%s' 'please wait, building help...'
typeset grouplist=$(mktemp /tmp/grouplist.XXXX)
typeset func
for func in $(typeset_functions)
do
typeset group="$(typeset -f $func | metafor group)"
if [ -z "$group" ]; then
group='misc'
fi
typeset about="$(typeset -f $func | metafor about)"
letterpress "$about" $func >> $grouplist.$group
echo $grouplist.$group >> $grouplist
done
# clear progress message
printf 'r%sn' ' '
typeset group
typeset gfile
for gfile in $(cat $grouplist | sort | uniq)
do
printf '%sn' "${gfile##*.}:"
cat $gfile
printf 'n'
rm $gfile 2> /dev/null
done | less
rm $grouplist 2> /dev/null
}
all_groups ()
{
about 'displays all unique metadata groups'
group 'lib'
typeset func
typeset file=$(mktemp /tmp/composure.XXXX)
for func in $(typeset_functions)
do
typeset -f $func | metafor group >> $file
done
cat $file | sort | uniq
rm $file
}
Do you have any ideas how to fix this? Please help, I'm literally an ubuntu noob. Thanks!
boot command-line bash upgrade
|
show 1 more comment
up vote
2
down vote
favorite
My laptop used to have Ubuntu 16.04 LTS. I upgraded it to Ubuntu 18.04 LTS. After upgrading, every time I boot it, it shows this error message:
Error found when loading /home/[user]/.profile:
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
As a result the session will not be configured correctly.
When I click OK, the message disappears. When I open the terminal, this appears:
continue: only meaningful in 'for', 'while', or 'until' loop
continue: only meaningful in 'for', 'while', or 'until' loop
continue: only meaningful in 'for', 'while', or 'until' loop
I tried editing line 6 of helpers.bash and changed continue to return but the problem still persists. This is the code for helpers.bash:
# Helper function loading various enable-able files
function _load_bash_it_files() {
subdirectory="$1"
if [ ! -d "${BASH_IT}/${subdirectory}/enabled" ]
then
continue
fi
FILES="${BASH_IT}/${subdirectory}/enabled/*.bash"
for config_file in $FILES
do
if [ -e "${config_file}" ]; then
source $config_file
fi
done
}
# Function for reloading aliases
function reload_aliases() {
_load_bash_it_files "aliases"
}
# Function for reloading auto-completion
function reload_completion() {
_load_bash_it_files "completion"
}
# Function for reloading plugins
function reload_plugins() {
_load_bash_it_files "plugins"
}
bash-it ()
{
about 'bash-it help and maintenance'
param '1: verb [one of: help | show | enable | disable ]'
param '2: component type [one of: alias(es) | completion(s) | plugin(s) ]'
param '3: specific component [optional]'
example '$ bash-it show plugins'
example '$ bash-it help aliases'
example '$ bash-it enable plugin git'
example '$ bash-it disable alias hg'
typeset verb=${1:-}
shift
typeset component=${1:-}
shift
typeset func
case $verb in
show)
func=_bash-it-$component;;
enable)
func=_enable-$component;;
disable)
func=_disable-$component;;
help)
func=_help-$component;;
*)
reference bash-it
return;;
esac
# pluralize component if necessary
if ! _is_function $func; then
if _is_function ${func}s; then
func=${func}s
else
if _is_function ${func}es; then
func=${func}es
else
echo "oops! $component is not a valid option!"
reference bash-it
return
fi
fi
fi
$func $*
}
_is_function ()
{
_about 'sets $? to true if parameter is the name of a function'
_param '1: name of alleged function'
_group 'lib'
[ -n "$(LANG=C type -t $1 2>/dev/null | grep 'function')" ]
}
_bash-it-aliases ()
{
_about 'summarizes available bash_it aliases'
_group 'lib'
_bash-it-describe "aliases" "an" "alias" "Alias"
}
_bash-it-completions ()
{
_about 'summarizes available bash_it completions'
_group 'lib'
_bash-it-describe "completion" "a" "completion" "Completion"
}
_bash-it-plugins ()
{
_about 'summarizes available bash_it plugins'
_group 'lib'
_bash-it-describe "plugins" "a" "plugin" "Plugin"
}
_bash-it-describe ()
{
_about 'summarizes available bash_it components'
_param '1: subdirectory'
_param '2: preposition'
_param '3: file_type'
_param '4: column_header'
_example '$ _bash-it-describe "plugins" "a" "plugin" "Plugin"'
subdirectory="$1"
preposition="$2"
file_type="$3"
column_header="$4"
typeset f
typeset enabled
printf "%-20s%-10s%sn" "$column_header" 'Enabled?' 'Description'
for f in $BASH_IT/$subdirectory/available/*.bash
do
if [ -e $BASH_IT/$subdirectory/enabled/$(basename $f) ]; then
enabled='x'
else
enabled=' '
fi
printf "%-20s%-10s%sn" "$(basename $f | cut -d'.' -f1)" " [$enabled]" "$(cat $f | metafor about-$file_type)"
done
printf 'n%sn' "to enable $preposition $file_type, do:"
printf '%sn' "$ bash-it enable $file_type <$file_type name> -or- $ bash-it enable $file_type all"
printf 'n%sn' "to disable $preposition $file_type, do:"
printf '%sn' "$ bash-it disable $file_type <$file_type name> -or- $ bash-it disable $file_type all"
}
_disable-plugin ()
{
_about 'disables bash_it plugin'
_param '1: plugin name'
_example '$ disable-plugin rvm'
_group 'lib'
_disable-thing "plugins" "plugin" $1
}
_disable-alias ()
{
_about 'disables bash_it alias'
_param '1: alias name'
_example '$ disable-alias git'
_group 'lib'
_disable-thing "aliases" "alias" $1
}
_disable-completion ()
{
_about 'disables bash_it completion'
_param '1: completion name'
_example '$ disable-completion git'
_group 'lib'
_disable-thing "completion" "completion" $1
}
_disable-thing ()
{
_about 'disables a bash_it component'
_param '1: subdirectory'
_param '2: file_type'
_param '3: file_entity'
_example '$ _disable-thing "plugins" "plugin" "ssh"'
subdirectory="$1"
file_type="$2"
file_entity="$3"
if [ -z "$file_entity" ]; then
reference "disable-$file_type"
return
fi
if [ "$file_entity" = "all" ]; then
typeset f $file_type
for f in $BASH_IT/$subdirectory/available/*.bash
do
plugin=$(basename $f)
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
fi
done
else
typeset plugin=$(command ls $BASH_IT/$subdirectory/enabled/$file_entity.*bash 2>/dev/null | head -1)
if [ -z "$plugin" ]; then
printf '%sn' "sorry, that does not appear to be an enabled $file_type."
return
fi
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
fi
printf '%sn' "$file_entity disabled."
}
_enable-plugin ()
{
_about 'enables bash_it plugin'
_param '1: plugin name'
_example '$ enable-plugin rvm'
_group 'lib'
_enable-thing "plugins" "plugin" $1
}
_enable-alias ()
{
_about 'enables bash_it alias'
_param '1: alias name'
_example '$ enable-alias git'
_group 'lib'
_enable-thing "aliases" "alias" $1
}
_enable-completion ()
{
_about 'enables bash_it completion'
_param '1: completion name'
_example '$ enable-completion git'
_group 'lib'
_enable-thing "completion" "completion" $1
}
_enable-thing ()
{
cite _about _param _example
_about 'enables a bash_it component'
_param '1: subdirectory'
_param '2: file_type'
_param '3: file_entity'
_example '$ _enable-thing "plugins" "plugin" "ssh"'
subdirectory="$1"
file_type="$2"
file_entity="$3"
if [ -z "$file_entity" ]; then
reference "enable-$file_type"
return
fi
if [ "$file_entity" = "all" ]; then
typeset f $file_type
for f in $BASH_IT/$subdirectory/available/*.bash
do
plugin=$(basename $f)
if [ ! -h $BASH_IT/$subdirectory/enabled/$plugin ]; then
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
fi
done
else
typeset plugin=$(command ls $BASH_IT/$subdirectory/available/$file_entity.*bash 2>/dev/null | head -1)
if [ -z "$plugin" ]; then
printf '%sn' "sorry, that does not appear to be an available $file_type."
return
fi
plugin=$(basename $plugin)
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
printf '%sn' "$file_entity is already enabled."
return
fi
mkdir -p $BASH_IT/$subdirectory/enabled
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
fi
printf '%sn' "$file_entity enabled."
}
_help-completions()
{
_about 'summarize all completions available in bash-it'
_group 'lib'
_bash-it-completions
}
_help-aliases()
{
_about 'shows help for all aliases, or a specific alias group'
_param '1: optional alias group'
_example '$ alias-help'
_example '$ alias-help git'
if [ -n "$1" ]; then
cat $BASH_IT/aliases/available/$1.aliases.bash | metafor alias | sed "s/$/'/"
else
typeset f
for f in $BASH_IT/aliases/enabled/*
do
typeset file=$(basename $f)
printf 'nn%s:n' "${file%%.*}"
# metafor() strips trailing quotes, restore them with sed..
cat $f | metafor alias | sed "s/$/'/"
done
fi
}
_help-plugins()
{
_about 'summarize all functions defined by enabled bash-it plugins'
_group 'lib'
# display a brief progress message...
printf '%s' 'please wait, building help...'
typeset grouplist=$(mktemp /tmp/grouplist.XXXX)
typeset func
for func in $(typeset_functions)
do
typeset group="$(typeset -f $func | metafor group)"
if [ -z "$group" ]; then
group='misc'
fi
typeset about="$(typeset -f $func | metafor about)"
letterpress "$about" $func >> $grouplist.$group
echo $grouplist.$group >> $grouplist
done
# clear progress message
printf 'r%sn' ' '
typeset group
typeset gfile
for gfile in $(cat $grouplist | sort | uniq)
do
printf '%sn' "${gfile##*.}:"
cat $gfile
printf 'n'
rm $gfile 2> /dev/null
done | less
rm $grouplist 2> /dev/null
}
all_groups ()
{
about 'displays all unique metadata groups'
group 'lib'
typeset func
typeset file=$(mktemp /tmp/composure.XXXX)
for func in $(typeset_functions)
do
typeset -f $func | metafor group >> $file
done
cat $file | sort | uniq
rm $file
}
Do you have any ideas how to fix this? Please help, I'm literally an ubuntu noob. Thanks!
boot command-line bash upgrade
Line 6 in the pasted file looks like "return", is that the right file? And what's created the~/.bash_it
folder?
– Xen2050
Dec 2 at 18:50
Line 6 was originally "continue" and in an effort to make it right I tried changing it to "return". Didn't work. I accidentally pasted the one where I changed line 6, sorry. About the ~/.bash_it, I'm not sure what you mean. Sorry, I'm kind of new to this.
– Pat
Dec 3 at 19:50
Does this have to do with github.com/Bash-it/bash-it ?
– mook765
Dec 3 at 20:45
Yes, I think so.
– Pat
Dec 4 at 6:45
Do you consider to upgrade to newer bash-it? Your version does not look like current. This already solved like 2 years ago.
– Alvin Liang
Dec 7 at 4:37
|
show 1 more comment
up vote
2
down vote
favorite
up vote
2
down vote
favorite
My laptop used to have Ubuntu 16.04 LTS. I upgraded it to Ubuntu 18.04 LTS. After upgrading, every time I boot it, it shows this error message:
Error found when loading /home/[user]/.profile:
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
As a result the session will not be configured correctly.
When I click OK, the message disappears. When I open the terminal, this appears:
continue: only meaningful in 'for', 'while', or 'until' loop
continue: only meaningful in 'for', 'while', or 'until' loop
continue: only meaningful in 'for', 'while', or 'until' loop
I tried editing line 6 of helpers.bash and changed continue to return but the problem still persists. This is the code for helpers.bash:
# Helper function loading various enable-able files
function _load_bash_it_files() {
subdirectory="$1"
if [ ! -d "${BASH_IT}/${subdirectory}/enabled" ]
then
continue
fi
FILES="${BASH_IT}/${subdirectory}/enabled/*.bash"
for config_file in $FILES
do
if [ -e "${config_file}" ]; then
source $config_file
fi
done
}
# Function for reloading aliases
function reload_aliases() {
_load_bash_it_files "aliases"
}
# Function for reloading auto-completion
function reload_completion() {
_load_bash_it_files "completion"
}
# Function for reloading plugins
function reload_plugins() {
_load_bash_it_files "plugins"
}
bash-it ()
{
about 'bash-it help and maintenance'
param '1: verb [one of: help | show | enable | disable ]'
param '2: component type [one of: alias(es) | completion(s) | plugin(s) ]'
param '3: specific component [optional]'
example '$ bash-it show plugins'
example '$ bash-it help aliases'
example '$ bash-it enable plugin git'
example '$ bash-it disable alias hg'
typeset verb=${1:-}
shift
typeset component=${1:-}
shift
typeset func
case $verb in
show)
func=_bash-it-$component;;
enable)
func=_enable-$component;;
disable)
func=_disable-$component;;
help)
func=_help-$component;;
*)
reference bash-it
return;;
esac
# pluralize component if necessary
if ! _is_function $func; then
if _is_function ${func}s; then
func=${func}s
else
if _is_function ${func}es; then
func=${func}es
else
echo "oops! $component is not a valid option!"
reference bash-it
return
fi
fi
fi
$func $*
}
_is_function ()
{
_about 'sets $? to true if parameter is the name of a function'
_param '1: name of alleged function'
_group 'lib'
[ -n "$(LANG=C type -t $1 2>/dev/null | grep 'function')" ]
}
_bash-it-aliases ()
{
_about 'summarizes available bash_it aliases'
_group 'lib'
_bash-it-describe "aliases" "an" "alias" "Alias"
}
_bash-it-completions ()
{
_about 'summarizes available bash_it completions'
_group 'lib'
_bash-it-describe "completion" "a" "completion" "Completion"
}
_bash-it-plugins ()
{
_about 'summarizes available bash_it plugins'
_group 'lib'
_bash-it-describe "plugins" "a" "plugin" "Plugin"
}
_bash-it-describe ()
{
_about 'summarizes available bash_it components'
_param '1: subdirectory'
_param '2: preposition'
_param '3: file_type'
_param '4: column_header'
_example '$ _bash-it-describe "plugins" "a" "plugin" "Plugin"'
subdirectory="$1"
preposition="$2"
file_type="$3"
column_header="$4"
typeset f
typeset enabled
printf "%-20s%-10s%sn" "$column_header" 'Enabled?' 'Description'
for f in $BASH_IT/$subdirectory/available/*.bash
do
if [ -e $BASH_IT/$subdirectory/enabled/$(basename $f) ]; then
enabled='x'
else
enabled=' '
fi
printf "%-20s%-10s%sn" "$(basename $f | cut -d'.' -f1)" " [$enabled]" "$(cat $f | metafor about-$file_type)"
done
printf 'n%sn' "to enable $preposition $file_type, do:"
printf '%sn' "$ bash-it enable $file_type <$file_type name> -or- $ bash-it enable $file_type all"
printf 'n%sn' "to disable $preposition $file_type, do:"
printf '%sn' "$ bash-it disable $file_type <$file_type name> -or- $ bash-it disable $file_type all"
}
_disable-plugin ()
{
_about 'disables bash_it plugin'
_param '1: plugin name'
_example '$ disable-plugin rvm'
_group 'lib'
_disable-thing "plugins" "plugin" $1
}
_disable-alias ()
{
_about 'disables bash_it alias'
_param '1: alias name'
_example '$ disable-alias git'
_group 'lib'
_disable-thing "aliases" "alias" $1
}
_disable-completion ()
{
_about 'disables bash_it completion'
_param '1: completion name'
_example '$ disable-completion git'
_group 'lib'
_disable-thing "completion" "completion" $1
}
_disable-thing ()
{
_about 'disables a bash_it component'
_param '1: subdirectory'
_param '2: file_type'
_param '3: file_entity'
_example '$ _disable-thing "plugins" "plugin" "ssh"'
subdirectory="$1"
file_type="$2"
file_entity="$3"
if [ -z "$file_entity" ]; then
reference "disable-$file_type"
return
fi
if [ "$file_entity" = "all" ]; then
typeset f $file_type
for f in $BASH_IT/$subdirectory/available/*.bash
do
plugin=$(basename $f)
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
fi
done
else
typeset plugin=$(command ls $BASH_IT/$subdirectory/enabled/$file_entity.*bash 2>/dev/null | head -1)
if [ -z "$plugin" ]; then
printf '%sn' "sorry, that does not appear to be an enabled $file_type."
return
fi
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
fi
printf '%sn' "$file_entity disabled."
}
_enable-plugin ()
{
_about 'enables bash_it plugin'
_param '1: plugin name'
_example '$ enable-plugin rvm'
_group 'lib'
_enable-thing "plugins" "plugin" $1
}
_enable-alias ()
{
_about 'enables bash_it alias'
_param '1: alias name'
_example '$ enable-alias git'
_group 'lib'
_enable-thing "aliases" "alias" $1
}
_enable-completion ()
{
_about 'enables bash_it completion'
_param '1: completion name'
_example '$ enable-completion git'
_group 'lib'
_enable-thing "completion" "completion" $1
}
_enable-thing ()
{
cite _about _param _example
_about 'enables a bash_it component'
_param '1: subdirectory'
_param '2: file_type'
_param '3: file_entity'
_example '$ _enable-thing "plugins" "plugin" "ssh"'
subdirectory="$1"
file_type="$2"
file_entity="$3"
if [ -z "$file_entity" ]; then
reference "enable-$file_type"
return
fi
if [ "$file_entity" = "all" ]; then
typeset f $file_type
for f in $BASH_IT/$subdirectory/available/*.bash
do
plugin=$(basename $f)
if [ ! -h $BASH_IT/$subdirectory/enabled/$plugin ]; then
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
fi
done
else
typeset plugin=$(command ls $BASH_IT/$subdirectory/available/$file_entity.*bash 2>/dev/null | head -1)
if [ -z "$plugin" ]; then
printf '%sn' "sorry, that does not appear to be an available $file_type."
return
fi
plugin=$(basename $plugin)
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
printf '%sn' "$file_entity is already enabled."
return
fi
mkdir -p $BASH_IT/$subdirectory/enabled
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
fi
printf '%sn' "$file_entity enabled."
}
_help-completions()
{
_about 'summarize all completions available in bash-it'
_group 'lib'
_bash-it-completions
}
_help-aliases()
{
_about 'shows help for all aliases, or a specific alias group'
_param '1: optional alias group'
_example '$ alias-help'
_example '$ alias-help git'
if [ -n "$1" ]; then
cat $BASH_IT/aliases/available/$1.aliases.bash | metafor alias | sed "s/$/'/"
else
typeset f
for f in $BASH_IT/aliases/enabled/*
do
typeset file=$(basename $f)
printf 'nn%s:n' "${file%%.*}"
# metafor() strips trailing quotes, restore them with sed..
cat $f | metafor alias | sed "s/$/'/"
done
fi
}
_help-plugins()
{
_about 'summarize all functions defined by enabled bash-it plugins'
_group 'lib'
# display a brief progress message...
printf '%s' 'please wait, building help...'
typeset grouplist=$(mktemp /tmp/grouplist.XXXX)
typeset func
for func in $(typeset_functions)
do
typeset group="$(typeset -f $func | metafor group)"
if [ -z "$group" ]; then
group='misc'
fi
typeset about="$(typeset -f $func | metafor about)"
letterpress "$about" $func >> $grouplist.$group
echo $grouplist.$group >> $grouplist
done
# clear progress message
printf 'r%sn' ' '
typeset group
typeset gfile
for gfile in $(cat $grouplist | sort | uniq)
do
printf '%sn' "${gfile##*.}:"
cat $gfile
printf 'n'
rm $gfile 2> /dev/null
done | less
rm $grouplist 2> /dev/null
}
all_groups ()
{
about 'displays all unique metadata groups'
group 'lib'
typeset func
typeset file=$(mktemp /tmp/composure.XXXX)
for func in $(typeset_functions)
do
typeset -f $func | metafor group >> $file
done
cat $file | sort | uniq
rm $file
}
Do you have any ideas how to fix this? Please help, I'm literally an ubuntu noob. Thanks!
boot command-line bash upgrade
My laptop used to have Ubuntu 16.04 LTS. I upgraded it to Ubuntu 18.04 LTS. After upgrading, every time I boot it, it shows this error message:
Error found when loading /home/[user]/.profile:
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
home/[user]/.bash_it/lib/helpers.bash: line 6: continue: only meaningful in 'for', 'while', or 'until' loop
As a result the session will not be configured correctly.
When I click OK, the message disappears. When I open the terminal, this appears:
continue: only meaningful in 'for', 'while', or 'until' loop
continue: only meaningful in 'for', 'while', or 'until' loop
continue: only meaningful in 'for', 'while', or 'until' loop
I tried editing line 6 of helpers.bash and changed continue to return but the problem still persists. This is the code for helpers.bash:
# Helper function loading various enable-able files
function _load_bash_it_files() {
subdirectory="$1"
if [ ! -d "${BASH_IT}/${subdirectory}/enabled" ]
then
continue
fi
FILES="${BASH_IT}/${subdirectory}/enabled/*.bash"
for config_file in $FILES
do
if [ -e "${config_file}" ]; then
source $config_file
fi
done
}
# Function for reloading aliases
function reload_aliases() {
_load_bash_it_files "aliases"
}
# Function for reloading auto-completion
function reload_completion() {
_load_bash_it_files "completion"
}
# Function for reloading plugins
function reload_plugins() {
_load_bash_it_files "plugins"
}
bash-it ()
{
about 'bash-it help and maintenance'
param '1: verb [one of: help | show | enable | disable ]'
param '2: component type [one of: alias(es) | completion(s) | plugin(s) ]'
param '3: specific component [optional]'
example '$ bash-it show plugins'
example '$ bash-it help aliases'
example '$ bash-it enable plugin git'
example '$ bash-it disable alias hg'
typeset verb=${1:-}
shift
typeset component=${1:-}
shift
typeset func
case $verb in
show)
func=_bash-it-$component;;
enable)
func=_enable-$component;;
disable)
func=_disable-$component;;
help)
func=_help-$component;;
*)
reference bash-it
return;;
esac
# pluralize component if necessary
if ! _is_function $func; then
if _is_function ${func}s; then
func=${func}s
else
if _is_function ${func}es; then
func=${func}es
else
echo "oops! $component is not a valid option!"
reference bash-it
return
fi
fi
fi
$func $*
}
_is_function ()
{
_about 'sets $? to true if parameter is the name of a function'
_param '1: name of alleged function'
_group 'lib'
[ -n "$(LANG=C type -t $1 2>/dev/null | grep 'function')" ]
}
_bash-it-aliases ()
{
_about 'summarizes available bash_it aliases'
_group 'lib'
_bash-it-describe "aliases" "an" "alias" "Alias"
}
_bash-it-completions ()
{
_about 'summarizes available bash_it completions'
_group 'lib'
_bash-it-describe "completion" "a" "completion" "Completion"
}
_bash-it-plugins ()
{
_about 'summarizes available bash_it plugins'
_group 'lib'
_bash-it-describe "plugins" "a" "plugin" "Plugin"
}
_bash-it-describe ()
{
_about 'summarizes available bash_it components'
_param '1: subdirectory'
_param '2: preposition'
_param '3: file_type'
_param '4: column_header'
_example '$ _bash-it-describe "plugins" "a" "plugin" "Plugin"'
subdirectory="$1"
preposition="$2"
file_type="$3"
column_header="$4"
typeset f
typeset enabled
printf "%-20s%-10s%sn" "$column_header" 'Enabled?' 'Description'
for f in $BASH_IT/$subdirectory/available/*.bash
do
if [ -e $BASH_IT/$subdirectory/enabled/$(basename $f) ]; then
enabled='x'
else
enabled=' '
fi
printf "%-20s%-10s%sn" "$(basename $f | cut -d'.' -f1)" " [$enabled]" "$(cat $f | metafor about-$file_type)"
done
printf 'n%sn' "to enable $preposition $file_type, do:"
printf '%sn' "$ bash-it enable $file_type <$file_type name> -or- $ bash-it enable $file_type all"
printf 'n%sn' "to disable $preposition $file_type, do:"
printf '%sn' "$ bash-it disable $file_type <$file_type name> -or- $ bash-it disable $file_type all"
}
_disable-plugin ()
{
_about 'disables bash_it plugin'
_param '1: plugin name'
_example '$ disable-plugin rvm'
_group 'lib'
_disable-thing "plugins" "plugin" $1
}
_disable-alias ()
{
_about 'disables bash_it alias'
_param '1: alias name'
_example '$ disable-alias git'
_group 'lib'
_disable-thing "aliases" "alias" $1
}
_disable-completion ()
{
_about 'disables bash_it completion'
_param '1: completion name'
_example '$ disable-completion git'
_group 'lib'
_disable-thing "completion" "completion" $1
}
_disable-thing ()
{
_about 'disables a bash_it component'
_param '1: subdirectory'
_param '2: file_type'
_param '3: file_entity'
_example '$ _disable-thing "plugins" "plugin" "ssh"'
subdirectory="$1"
file_type="$2"
file_entity="$3"
if [ -z "$file_entity" ]; then
reference "disable-$file_type"
return
fi
if [ "$file_entity" = "all" ]; then
typeset f $file_type
for f in $BASH_IT/$subdirectory/available/*.bash
do
plugin=$(basename $f)
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
fi
done
else
typeset plugin=$(command ls $BASH_IT/$subdirectory/enabled/$file_entity.*bash 2>/dev/null | head -1)
if [ -z "$plugin" ]; then
printf '%sn' "sorry, that does not appear to be an enabled $file_type."
return
fi
rm $BASH_IT/$subdirectory/enabled/$(basename $plugin)
fi
printf '%sn' "$file_entity disabled."
}
_enable-plugin ()
{
_about 'enables bash_it plugin'
_param '1: plugin name'
_example '$ enable-plugin rvm'
_group 'lib'
_enable-thing "plugins" "plugin" $1
}
_enable-alias ()
{
_about 'enables bash_it alias'
_param '1: alias name'
_example '$ enable-alias git'
_group 'lib'
_enable-thing "aliases" "alias" $1
}
_enable-completion ()
{
_about 'enables bash_it completion'
_param '1: completion name'
_example '$ enable-completion git'
_group 'lib'
_enable-thing "completion" "completion" $1
}
_enable-thing ()
{
cite _about _param _example
_about 'enables a bash_it component'
_param '1: subdirectory'
_param '2: file_type'
_param '3: file_entity'
_example '$ _enable-thing "plugins" "plugin" "ssh"'
subdirectory="$1"
file_type="$2"
file_entity="$3"
if [ -z "$file_entity" ]; then
reference "enable-$file_type"
return
fi
if [ "$file_entity" = "all" ]; then
typeset f $file_type
for f in $BASH_IT/$subdirectory/available/*.bash
do
plugin=$(basename $f)
if [ ! -h $BASH_IT/$subdirectory/enabled/$plugin ]; then
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
fi
done
else
typeset plugin=$(command ls $BASH_IT/$subdirectory/available/$file_entity.*bash 2>/dev/null | head -1)
if [ -z "$plugin" ]; then
printf '%sn' "sorry, that does not appear to be an available $file_type."
return
fi
plugin=$(basename $plugin)
if [ -e $BASH_IT/$subdirectory/enabled/$plugin ]; then
printf '%sn' "$file_entity is already enabled."
return
fi
mkdir -p $BASH_IT/$subdirectory/enabled
ln -s ../available/$plugin $BASH_IT/$subdirectory/enabled/$plugin
fi
printf '%sn' "$file_entity enabled."
}
_help-completions()
{
_about 'summarize all completions available in bash-it'
_group 'lib'
_bash-it-completions
}
_help-aliases()
{
_about 'shows help for all aliases, or a specific alias group'
_param '1: optional alias group'
_example '$ alias-help'
_example '$ alias-help git'
if [ -n "$1" ]; then
cat $BASH_IT/aliases/available/$1.aliases.bash | metafor alias | sed "s/$/'/"
else
typeset f
for f in $BASH_IT/aliases/enabled/*
do
typeset file=$(basename $f)
printf 'nn%s:n' "${file%%.*}"
# metafor() strips trailing quotes, restore them with sed..
cat $f | metafor alias | sed "s/$/'/"
done
fi
}
_help-plugins()
{
_about 'summarize all functions defined by enabled bash-it plugins'
_group 'lib'
# display a brief progress message...
printf '%s' 'please wait, building help...'
typeset grouplist=$(mktemp /tmp/grouplist.XXXX)
typeset func
for func in $(typeset_functions)
do
typeset group="$(typeset -f $func | metafor group)"
if [ -z "$group" ]; then
group='misc'
fi
typeset about="$(typeset -f $func | metafor about)"
letterpress "$about" $func >> $grouplist.$group
echo $grouplist.$group >> $grouplist
done
# clear progress message
printf 'r%sn' ' '
typeset group
typeset gfile
for gfile in $(cat $grouplist | sort | uniq)
do
printf '%sn' "${gfile##*.}:"
cat $gfile
printf 'n'
rm $gfile 2> /dev/null
done | less
rm $grouplist 2> /dev/null
}
all_groups ()
{
about 'displays all unique metadata groups'
group 'lib'
typeset func
typeset file=$(mktemp /tmp/composure.XXXX)
for func in $(typeset_functions)
do
typeset -f $func | metafor group >> $file
done
cat $file | sort | uniq
rm $file
}
Do you have any ideas how to fix this? Please help, I'm literally an ubuntu noob. Thanks!
boot command-line bash upgrade
boot command-line bash upgrade
edited Dec 3 at 19:51
asked Dec 2 at 6:35
Pat
112
112
Line 6 in the pasted file looks like "return", is that the right file? And what's created the~/.bash_it
folder?
– Xen2050
Dec 2 at 18:50
Line 6 was originally "continue" and in an effort to make it right I tried changing it to "return". Didn't work. I accidentally pasted the one where I changed line 6, sorry. About the ~/.bash_it, I'm not sure what you mean. Sorry, I'm kind of new to this.
– Pat
Dec 3 at 19:50
Does this have to do with github.com/Bash-it/bash-it ?
– mook765
Dec 3 at 20:45
Yes, I think so.
– Pat
Dec 4 at 6:45
Do you consider to upgrade to newer bash-it? Your version does not look like current. This already solved like 2 years ago.
– Alvin Liang
Dec 7 at 4:37
|
show 1 more comment
Line 6 in the pasted file looks like "return", is that the right file? And what's created the~/.bash_it
folder?
– Xen2050
Dec 2 at 18:50
Line 6 was originally "continue" and in an effort to make it right I tried changing it to "return". Didn't work. I accidentally pasted the one where I changed line 6, sorry. About the ~/.bash_it, I'm not sure what you mean. Sorry, I'm kind of new to this.
– Pat
Dec 3 at 19:50
Does this have to do with github.com/Bash-it/bash-it ?
– mook765
Dec 3 at 20:45
Yes, I think so.
– Pat
Dec 4 at 6:45
Do you consider to upgrade to newer bash-it? Your version does not look like current. This already solved like 2 years ago.
– Alvin Liang
Dec 7 at 4:37
Line 6 in the pasted file looks like "return", is that the right file? And what's created the
~/.bash_it
folder?– Xen2050
Dec 2 at 18:50
Line 6 in the pasted file looks like "return", is that the right file? And what's created the
~/.bash_it
folder?– Xen2050
Dec 2 at 18:50
Line 6 was originally "continue" and in an effort to make it right I tried changing it to "return". Didn't work. I accidentally pasted the one where I changed line 6, sorry. About the ~/.bash_it, I'm not sure what you mean. Sorry, I'm kind of new to this.
– Pat
Dec 3 at 19:50
Line 6 was originally "continue" and in an effort to make it right I tried changing it to "return". Didn't work. I accidentally pasted the one where I changed line 6, sorry. About the ~/.bash_it, I'm not sure what you mean. Sorry, I'm kind of new to this.
– Pat
Dec 3 at 19:50
Does this have to do with github.com/Bash-it/bash-it ?
– mook765
Dec 3 at 20:45
Does this have to do with github.com/Bash-it/bash-it ?
– mook765
Dec 3 at 20:45
Yes, I think so.
– Pat
Dec 4 at 6:45
Yes, I think so.
– Pat
Dec 4 at 6:45
Do you consider to upgrade to newer bash-it? Your version does not look like current. This already solved like 2 years ago.
– Alvin Liang
Dec 7 at 4:37
Do you consider to upgrade to newer bash-it? Your version does not look like current. This already solved like 2 years ago.
– Alvin Liang
Dec 7 at 4:37
|
show 1 more comment
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1097843%2fupgraded-to-ubuntu-18-04-lts-and-now-there-is-error-found-when-loading-home-us%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1097843%2fupgraded-to-ubuntu-18-04-lts-and-now-there-is-error-found-when-loading-home-us%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Line 6 in the pasted file looks like "return", is that the right file? And what's created the
~/.bash_it
folder?– Xen2050
Dec 2 at 18:50
Line 6 was originally "continue" and in an effort to make it right I tried changing it to "return". Didn't work. I accidentally pasted the one where I changed line 6, sorry. About the ~/.bash_it, I'm not sure what you mean. Sorry, I'm kind of new to this.
– Pat
Dec 3 at 19:50
Does this have to do with github.com/Bash-it/bash-it ?
– mook765
Dec 3 at 20:45
Yes, I think so.
– Pat
Dec 4 at 6:45
Do you consider to upgrade to newer bash-it? Your version does not look like current. This already solved like 2 years ago.
– Alvin Liang
Dec 7 at 4:37