Solution for the ".bashrc vs ssh command" problem

Posted by daniel on 25 June, 2012
Category Linux

Some Linux users (including myself) have been unsuccessfully trying to execute a command via SSH, for example:

ssh user@host mycommand


The problem seems to be that "mycommand" is in a directory that is not in the PATH. However, when they connect normally, they can see the directory in the PATH environment variable.

It seems that most of these users (again, including myself) update the PATH variable in the .bashrc file and, apparently, the .bashrc file is not executed when connected "non-interactively" via ssh.

After looking for a good while, many people suggested to check if the .bashrc was called by .profile or .bash_profile or something like that. Well... that did not solve my problem.

What, in fact, happened was that .bashrc was being called (or "sourced") by SSH, but the guys from the distro decided to add the following lines in it:

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


Basically, the test above only allows the execution of the rest of .bashrc if it is an interactive shell, thus it does not work for my needs. Why is it there? I have no idea... anyway... I just commented the test and it worked perfectly.

 

 


Comments


journal of enzyme inhibition and medicinal chemistry <a href=http://www.rgdmape.com/fiere/cytotec.html>donde comprar misoprostol en costa rica</a> sacramento family medical clinic
  ascertincareE // 01 December, 2013 / 16:23:30
--------------------------

Prezzo Cialis In Svizzera Cialis Requiere Receta Medica <a href=http://edfastmedrxfor.com>cialis</a> Can Cephalexin Affect Your Birth Control Primolut To Buy Online Secure Viagra Acheter Cialis Generique France Abilify Price Non Prescription Prix Cialis En Belgique <a href=http://edfastmedrxshop.com>viagra</a> Buy Zithromax Online Canada Direct Macrobid Pills Low Price Pharmacy Cash On Delivery Buy Propecia Online Topix Find Cheapeast Elocon 5g Worldwide Website Saturday Delivery Where To Buy Hormonin Tablets <a href=http://drisdol.com>cialis</a> Viagra Efectos En El Hombre Europharmacy Order Generic Accutane <a href=http://clomiphene60.com>clomiphene capsules for sale</a> Plavix Online Purchase Buy Flagyl 500mg Online Cialis 5 Mg Foro Zithromax India Cialis Viagra Comparatif <a href=http://ativana.com>viagra</a> Achat Cialis Angleterre Pflanzliches Viagra Rezeptfrei <a href=http://mo-bik.com>kamagra australia mastrcard</a> Prix De Kamagra Kamagra Original Falschung Worldwide Macrobid On Line <a href=http://buyprednisone10mg.com>ordering prednisone from canada</a> Viagra Funziona Veramente Buy Azithromycin Zithromax <a href=http://fast-isotretinoin.com>isotretinoin</a> Order Now Cash On Delivery Stendra Next Day Berlin Cialis 20 Pharmacie Buy Viagra Online In Malaysia Propecia Coupons <a href=http://bhdrugs.com>viagra online pharmacy</a> Propecia Femenino Se Vende Viagra <a href=http://shopbestedmedrx.com>cialis</a> Kamagra Oral Jelly Where To Buy Best Rated Generic Buspar Pharmacy Cialis Generico Farmacia Online Cialis Bugiardino <a href=http://fair-rx.com>who makes kamagra</a> Buy now isotretinoin oratane Purchase Synthroid Online No Prescription <a href=http://addrall.com>order alli online</a> Kanada Levitra Bestellen Achat Baclofene Sans Ordonnance Can I Take Sudafed With Amoxicillin Real Viagra Online Canadian Pharmacy Lexapro Online No Rx Amoxil Sur L' <a href=http://tri-rx.net>comprar viagra generica online</a> Vente Cytotec Cialis En Ligne Canada Kamagra Prescrizione France Priligy Se Puede Tomar Con Viagra Generic Amoxicilina Website Fedex No Doctor Buy Ciprofloxacin Hydrochloride <a href=http://uspapz.com>viagra prescription</a> Viagra Und Co Kaufen Cialis Generico 20 Mg Indocin Fast Delivery Generic Viagra <a href=http://tromal.com>kamagra uk next day delivery paypal 306</a> Finasteride 1 Mg Generique
  BryAlara // 16 November, 2016 / 08:53:57
--------------------------

Sleep apnea has long disrupted the lives of untold number of sufferers as well as their loved ones. To stand a good chance of effectively manage this difficult condition, solid knowledge and understanding of its causes is necessary. Apply the information in this piece, and you will possess the information needed to mitigate the impact sleep apnea has on your life.

Skip sleeping pills if you are prone to bouts of sleep apnea. You may feel you need them to get to sleep, but they have a similar effect as alcohol on the body. They also have additional side effects besides the obvious ones. Stay away if you want to lessen your sleep apnea symptoms.

If you have sleep apnea, try sleeping on your side. If you are a back or stomach sleeper, gravity is working against you all night. Your airway is much more likely to collapse if you are facing straight up or down. Sleeping on your side instead makes it much easier for your body to maintain your airway as you sleep.

Improve your sleep apnea by slimming down a bit. Recent research showed dramatic improvements in overweight men who shed 25 pounds over a period of one year to reduce sleep apnea symptoms. In some cases, the weight loss resulted in a cure of sleep apnea where no further treatment of the condition was necessary.

Sleep apnea can benefit from a good diet that results in your losing weight. Normally people are quite surprised to learn that unhealthy eating is a major source of their sleep apnea. It's been proven that poor diets can contribute to the severity of sleep apnea.

Drink one cup of caffeinated coffee a few hours before you go to sleep. It may seem silly to drink a caffeine drink at night, but this can actually help keep your throat open while you sleep. You may have to play around with what time you drink the coffee to avoid restlessness.

Consider an alternative sleep apnea flower remedy therapy (also known as essence therapy). Vervain is used in this treatment for its calming and relaxing effects. This can help treat your symptoms, including insomnia problems associated with your apnea. As an added bonus, it also helps reduce overall stress and lower high blood pressure.

If you use a continuous positive airway pressure, or CPAP machine to treat your sleep apnea, sleep with it every night. When you take the mask off at night, your symptoms will return. Sometimes they might disappear for one or two nights, but then return. Wearing the mask every night prevents episodes of sleep apnea from occurring.

If simple changes in your lifestyle, such as regular sleep hours and losing weight, have not eliminated your sleep apnea episodes, it is time to consult with a sleep specialist. The specific causes of your sleep apnea can be evaluated, and an individual treatment plan can be designed for you.

Learning more about sleep apnea is important because knowledge can help put your mind at ease. Take the information you have learned in this article and talk to your doctor about it. He or she can then better help you more easily when you know more about this disorder yourself.

<a href=https://www.viagrasansordonnancefr.com/>viagrasansordonnancefr.com</a>
  Matthewmup // 26 April, 2017 / 18:20:25
--------------------------

Leave comment

 
« Prev item • Next item »