Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Terminal Startup Commands

So I was reading online about how to make Terminal run a command on startup. When entering the commands to make it run a command on the start of Terminal I guess I messed up, now whenever I start Terminal it says [Process Completed] and wont let me enter any more commands. It also does this when I open a new shell. I want to know if there is a way to delete this startup command so Terminal opens as it does out of the box.

Mac OS X (10.6.3)

Posted on May 28, 2010 5:41 PM

Reply
9 replies

May 28, 2010 6:31 PM in response to supergeek66

I assume you are talking about a file with a name such as .profile, .bashrc, .bash_profile, etc... That is to say a file start starts with a dot (aka period).

You can use a utility such as Onyx
<http://www.versiontracker.com/dyn/moreinfo/macosx/20070>
Onyx -> Parameters -> Finder -> [X] Show hidden files and folders

The Finder should now show you the .profile, .bashrc, .bash_profile, etc... file or files in your home directory. You can now delete the offending file.

Then use Onyx to hide those files again.

If you were talking about Terminal -> Preferences -> Startup -> Command, then you can delete
/Users/your username/Library/Preferences/com.apple.Terminal.plist

Message was edited by: BobHarris

May 28, 2010 7:15 PM in response to BobHarris

The following Applescript will also show (and hide) the hidden files in Finder:

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #E6E6EE;
overflow: auto;"
title="this text can be pasted into the AppleScript Editor">

set answer to the button returned of (display dialog ("Finder Hidden Files:") buttons {"Show", "Hide", "Cancel"} with icon caution default button 3 with title "Finder Hidden Files")
if answer is "Show" then
tell application "Finder" to quit
do shell script "defaults write com.apple.finder AppleShowAllFiles 1"
delay 2
tell application "Finder" to run
else
tell application "Finder" to quit
do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
delay 2
tell application "Finder" to run
end if</pre>

May 29, 2010 10:05 AM in response to supergeek66

Is there a way to figure out which file is the offending file. The computer I am using is a shared computer with many users.

If you DID NOT touch files in /etc, then the files are specific to your account.
When Terminal opens in a different user it responds normally so the offending file is within my user. If you could give me a list of files that might be the bad one that would be great.

What file did you create?

It will most likely start with a dot.

A lot depends on what shell you are using. bash is the default, but there are other shells, such as sh, ksh, zsh, csh, and tcsh

Possible names are, and there could be more

.profile
.bash_profile
.bash_login
.bashrc
.login
.cshrc
.tcshrc
.kshrc
.zshrc
.zshenv
.zprofile
.zlogin

May 30, 2010 1:27 AM in response to Tony T1

Or this shell script->

#!/bin/sh
#showallfiles
# Description and usage message
usage () {
echo "
Description:
A simple shell script to reveal/conceal files
hidden in Mac OS X Finder application.
showallfiles excepts one option.
Usage: ${0##*/} [-h|--help] to show this help
${0##*/} [on|ON] to show hidden files
${0##*/} [off|OFF] to set the default hidden files
Example: ${0##*/} on
"
}
# Test for more than one option
if [ $# -gt 1 ]
then echo "${0##*/} -h to access help"; exit
fi
# Get the AppleShowAllFiles status in the domain com.apple.finder.plist or create the default off setting
STATUS=`defaults read com.apple.finder AppleShowAllFiles 2>/dev/null` || STATUS=`defaults write com.apple.finder AppleShowAllFiles OFF`
# Function to check AppleShowAllFiles status and change the status if necessary
finderfilesstatus () {
if [ "$STATUS" = "$SAF_OPT" ]
then
echo "AppleShowAllFiles is set to $SAF_OPT"
else
defaults write com.apple.finder AppleShowAllFiles $SAF_OPT
osascript -e 'tell application "Finder" to quit' -e 'delay 1' -e 'tell application "Finder" to launch'
fi
}
# Parse the command option
case "$1" in
'-h'|'--help') usage; exit;;
'on'|'ON') SAF_OPT="ON"; finderfilesstatus;;
'off'|'OFF') SAF_OPT="OFF"; finderfilesstatus;;
*) echo "${0##*/} -h to access help"; exit;;
esac

Jun 22, 2010 11:22 PM in response to supergeek66

Assuming you haven't changed too much else, you're probably using "bash" as your shell. In that case, you can do this:

1. go to Terminal->Preferences and click the "Startup" tab

2. change "Shells open with:" to "command (complete path)"

3. change the command to "/bin/bash -v -x -l" (without the quotes)

4. click the "Settings" tab, then back to the "Startup" tab to make sure your edits took, then close the preferences window.

Now when you open a terminal, bash will print out everything it's trying to do before it does it. The last thing you see before "Process Completed" is probably the culprit. If you scroll up a bit, you should see a line that starts with a dot (".") that names the file with the problem command.

Terminal Startup Commands

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.