0

Tried following things:

1) added "export OSTYPE=linux" in .bashrc

closed the terminal

opened the terminal

echo $OSTYPE

o/p - linux-gnu

2) added "export OSTYPE=linux" in .profile

closed the terminal

opened the terminal

echo $OSTYPE

o/p - linux-gnu

user3181411
  • 135
  • 1
  • 5
  • 11
  • Try `source ~/.bashrc` rather than "opening/closing"? Though it sounds like OSTYPE is an environment variable, which it's unlikely you can overwrite – Reinstate Monica Please Feb 04 '14 at 07:04
  • YES, it worked fine but when i reopened the terminal it still same "linux-gnu" – user3181411 Feb 04 '14 at 07:09
  • I suspect it's setting OSTYPE as an environment variable after .bashrc gets `sourced` when you open terminal, which doesn't happen when you just `source` it. – Reinstate Monica Please Feb 04 '14 at 07:18
  • Another possibility is it's set in another bash file which gets sourced after `.bashrc`. Can you post output of `grep "OSTYPE" ~/.bash* /etc/bash.bashrc` – Reinstate Monica Please Feb 04 '14 at 07:25
  • /home/PU/pratik.prajapati/.bash_history:echo $OSTYPE /home/PU/pratik.prajapati/.bash_history:export OSTYPE=linux /home/PU/pratik.prajapati/.bash_history:echo $OSTYPE /home/PU/pratik.prajapati/.bash_profile:export OSTYPE=linux /home/PU/pratik.prajapati/.bashrc:export OSTYPE=linux /home/PU/pratik.prajapati/.bashrc_old:export OSTYPE=linux – user3181411 Feb 04 '14 at 07:31
  • Can't reproduce the "bug".. I've inserted `export OSTYPE=linux` into `.bashrc` and restared the shell, ad got: 'linux'. – Малъ Скрылевъ Feb 04 '14 at 07:49
  • Interesting, tried it again and can't reproduce either. Though still not sure it's a bug regardless, depending on when bash shell variables are set. – Reinstate Monica Please Feb 04 '14 at 08:01
  • how can i correct it ? – user3181411 Feb 04 '14 at 08:35
  • If you terminal starts a login shell, it will source `.bash_profile` or `.bash_login` if present instead of `.profile`, and will not source `.bashrc` at all unless one of the 3 login configuration files sources it explicitly. – chepner Feb 04 '14 at 14:45

0 Answers0