0

Before I start, I just wanna say I've looked for over an hour for an answer but can't find anything.

Basically I use Ubuntu through VirtualBox which works fine. I installed NetKit because that's what I'm using in Uni and it also works fine, however, everytime I restart Ubuntu, I have to keep entering these 3 commands in order to make NetKit work again (idk why), so I thought I'd make a script to automatically do this everytime I start up Ubuntu.

I know it opens a sub-shell to run the commands and then closes itself, which is why it doesn't work. I was just hoping someone could tell me a workaround for this and make it run in the main terminal:

#!/bin/bash
#Set the Netkit home

export NETKIT_HOME=/home/yusuf/Desktop/NetKit/netkit

export MANPATH=:$NETKIT_HOME/man

export PATH=$NETKIT_HOME/bin:$PATH

I tried adding . netkit_start.sh but it just has an error which says Segmentation fault (core dumped)

Thanks for the help

14
  • Have you considered putting these contents in your .bash_profile rather than a separate script? Commented Oct 10, 2017 at 21:48
  • BTW, do read the linked questions -- neither is just "you can't do it"; each describes an adequate workaround. Commented Oct 10, 2017 at 21:50
  • (btw, a segfault when sourcing a file is really a very separate problem, which we'd want to investigate separately; generally speaking, any time the shell segfaults, you've triggered a bug in the shell -- and they're generally a lot harder to find than this. I wonder if maybe your file is saved in an unusual format like UTF-16? That can happen if you created it on Windows). Commented Oct 10, 2017 at 21:52
  • ...consider (set -x; . netkit_start.sh) to log commands as the shell runs them, so we can get a better idea of exactly where that segfault is happening. But here, as in general, a segfault is more something to report to the software's vendor or your OS vendor than something you've done wrong. Commented Oct 10, 2017 at 21:53
  • @CharlesDuffy I just get +++++++++++ . netkit_start.sh ++++++++++++++++++++++++++++++++++++++++ set -x (And then it just repeats forever.. CTRL+C doesn't stop it Commented Oct 10, 2017 at 21:59

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.