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 6683527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:49:55+00:00 2026-05-26T04:49:55+00:00

I use my mac at home and at work. And I use a program

  • 0

I use my mac at home and at work. And I use a program called Marco-polo to detect whether I am at home or at work. Through this, I can get it to run a script that changes my proxy and run some scripts to configure my computer differently for the different environments like copying hosts.work and hosts.home over /etc/hosts and copy .profile.work and .profile.home over ~/.profile.

What I have not been able to do successfully so far, is to find a way to have all my running terminals reload my .profile file when I change location. Can anyone suggest a method for doing this?

Thanks, Tom


fm48 answer below in combination with this simple script (placed at /usr/bin/pkill) worked perfectly.

#!/bin/sh
sig=""
if [[ "$1" =~ - ]]; then
  sig=$1;
  shift
fi

for X in `ps acx | grep -i $1 | awk {'print $1'}`; do
    kill $sig $X;
done
  • 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-26T04:49:55+00:00Added an answer on May 26, 2026 at 4:49 am

    You should use a signal like SIGUSR1. First enable the signal to reload the ~/.profile with trap ". ${HOME}/.profile" SIGUSR1.

    After that you should send all shells the SIGUSR1 signal. For example pkill -SIGUSR1 bash if bash is the used shell.

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

Sidebar

Related Questions

I use a PC at home and a Mac at work. I've never had
I use a Mac at home and love it, but in my work environment/career
I don't use a mac much so my exposure is minimal but can I
Let me preface this question by saying I use TextMate on Mac OSX for
in Linux and Mac OS X I can use stepi and nexti to debug
I'm still trying to decide whether my (home) project should use UTF-8 strings (implemented
Mac OS X has the CA keystore in /System/Library/Frameworks/JavaVM.framework/Home/lib/security/cacerts. This keystore seems to be
I use Mac as my primary OS, but I often work on ASP.NET MVC
I've got a Mac that I can run either the Leopard (10.5) or Snow
I'm supposed to use a data analysis program for a physics experiment. I can't

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.