Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6982771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:19:56+00:00 2026-05-27T18:19:56+00:00

I recently added the following bash function definition to my /etc/profile in Ubuntu 11.04

  • 0

I recently added the following bash function definition to my /etc/profile in Ubuntu 11.04 (it’s a function to shortcut a CD command to a specific development directory):

################## JMOZTELEPORT BEGIN ##################

function JMozTeleport() {
  version=0.4.58
  pathtopythonpackages=`python -c "from site import getsitepackages; print getsitepackages()[0]"`
  pathtopythonteleport="$pathtopythonpackages/JMozTools-$version-py2.7.egg/JMozTools/JMozTeleport.py"

  # $1 is the command to run
  isversion=0
  ishelp=0
  if [[ "$1" == "-v"  || "$1" == "--version" ]]
  then
    isversion=1;
  fi
  if [[ "$1" == "-h"  || "$1" == "--help" ]]
  then
    ishelp=1;
  fi
  if [ -z $1 ]
  then
    python "$pathtopythonteleport" "-h"
  elif [ $1 == "version" ]
  then
    echo $version
  elif [ $isversion == 1 -o $ishelp == 1 ]
  then
    python "$pathtopythonteleport" "$@"
  else
    cd $(python "$pathtopythonteleport" "$@")
  fi
}
################### JMOZTELEPORT END ###################

Once I do this, though, (which works fine if I source /etc/profile from a terminal shell), I am unable to login to Gnome. It logs in ok, but then it immediately closes Gnome and brings me back to the login screen. If I remove this stuff from my /etc/profile, it again allows me to login fine.

I’m confused as to what is causing this to make gnome restart. Any ideas as to where the problem is?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:19:57+00:00Added an answer on May 27, 2026 at 6:19 pm

    /etc/profile is sourced by /bin/sh, something that probably happens during Gnome startup. It’s probably choking on the [[ ... ]] syntax, which is bash-specific. (/bin/sh may or may not be a symlink to /bin/bash, depending on the system).

    Since your function appears to be bash-specific, you might consider putting it in /etc/bash.bashrc rather than /etc/profile, or perhaps even $HOME/.bashrc. (Do you need it in non-interactive shells?)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently added the following line of Javascript code to a few pages
I recently added a new table to my database and am getting the following
Hey all, I have the following problem. I recently added an extra column to
I have recently come upon an error when I added the following to my
I have recently added a Photoswipe gallery to my website which has the following
I recently added an extra authentication backend to allow users to login using either
I recently added a stored procedure to my SQL Azure database. I added that
I recently added Autofac 2.6.2 to one of my ASP.NET MVC projet. I'm facing
I recently added Android's LVL copy protection to my app, and the results have
I recently added a feature to a large application written in Delphi (version 2009)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.