Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chown33

Moderator
Staff member
Aug 9, 2009
10,998
8,887
A sea of green
Snag a copy of Textwrangler if vi is too much, free and really nice for all things text on a Mac.

Or as I said early on, restore the file from Time Machine. It hasn't changed in a long time, you can even get a copy from 10.9, they're identical.

I agree on both points.

If TextWrangler is used, then copy and paste the following text into it:
Code:
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
	eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
	[ -r /etc/bashrc ] && . /etc/bashrc
fi[/QUOTE]
The resulting file length should be exactly 189 bytes.

---------------

There are several problems in the OP's hexdump output:
Code:
00000000 23 20 53 79 73 74 65 6d 2d 77 69 64 65 20 2e 70 |# System-wide .p|
00000010 72 6f 66 69 6c 65 20 66 6f 72 20 73 68 28 31 29 |rofile for sh(1)|
00000020 0a e2 80 a8 0a 69 66 20 5b 20 2d 78 20 2f 75 73 |.....if [ -x /us|
00000030 72 2f 6c 69 62 65 78 65 63 2f 70 61 74 68 5f 68 |r/libexec/path_h|
00000040 65 6c 70 65 72 20 5d 3b 20 74 68 65 6e 0a 65 76 |elper ]; then.ev|
00000050 61 6c 20 60 2f 75 73 72 2f 6c 69 62 65 78 65 63 |al `/usr/libexec|
00000060 2f 70 61 74 68 5f 68 65 6c 70 65 72 20 2d 73 60 |/path_helper -s`|
00000070 0a 66 69 0a e2 80 a8 0a 69 66 20 5b 20 e2 80 9c |.fi.....if [ ...|
00000080 24 7b 42 41 53 48 2d 6e 6f 7d e2 80 9d 20 21 3d |${BASH-no}... !=|
00000090 20 e2 80 9c 6e 6f e2 80 9d 20 5d 3b 20 74 68 65 | ...no... ]; the|
000000a0 6e 0a 5b 20 2d 72 20 2f 65 74 63 2f 62 61 72 73 |n.[ -r /etc/bars|
000000b0 68 72 63 20 5d 20 26 26 20 2e 20 2f 65 74 63 2f |hrc ] && . /etc/|
000000c0 62 61 73 68 72 63 0a 66 69 0a |bashrc.fi.|
000000ca
It looks like some of this text was manually retyped into the editor.

The first reason I suspect this is the "/etc/bars" at the end of line 00a0, which is part of the filename "/etc/barshrc". This is wrong: there should be no 'r' between "ba" and 's'. Looking back through the OP's posts, this typo appears consistently. If he'd copied and pasted from post #8, then there should have been no opportunity for mistyping anything.

The use of "barshrc" also explains why "bashrc" wasn't being loaded.

Second, the byte sequences that begin "e2 80" are the following Unicode characters, represented as UTF-8 codes:
e2 80 a8 -- \u2028 .. line separator
e2 80 9c -- \u201c .. open curly "
e2 80 9d -- \u201d .. close curly "
How "line separator" got there is a puzzle, but may be due to conversion from RTF to plain text.

The curly quotes should not be there at all if the text was pasted into the file. Instead, this looks like it was typed in, and Smart Quotes was enabled either system-wide:
System Preferences > Language & Text > Text > Smart Quotes​
or in TextEdit's Preferences window (look for a checkbox under New Documents).

Since smart quotes should only apply to what's typed, not what's pasted, it suggests that some of the text containing quotes was typed in.
 

yollo

macrumors newbie
Original poster
Sep 17, 2014
15
0
Snag a copy of Textwrangler if vi is too much, free and really nice for all things text on a Mac.

Or as I said early on, restore the file from Time Machine. It hasn't changed in a long time, you can even get a copy from 10.9, they're identical.

Unfortunately, I have not set up time machine...

----------

I agree on both points.

If TextWrangler is used, then copy and paste the following text into it:
Code:
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
	eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
	[ -r /etc/bashrc ] && . /etc/bashrc
fi[/QUOTE]
The resulting file length should be exactly 189 bytes.

---------------

There are several problems in the OP's hexdump output:
Code:
00000000 23 20 53 79 73 74 65 6d 2d 77 69 64 65 20 2e 70 |# System-wide .p|
00000010 72 6f 66 69 6c 65 20 66 6f 72 20 73 68 28 31 29 |rofile for sh(1)|
00000020 0a e2 80 a8 0a 69 66 20 5b 20 2d 78 20 2f 75 73 |.....if [ -x /us|
00000030 72 2f 6c 69 62 65 78 65 63 2f 70 61 74 68 5f 68 |r/libexec/path_h|
00000040 65 6c 70 65 72 20 5d 3b 20 74 68 65 6e 0a 65 76 |elper ]; then.ev|
00000050 61 6c 20 60 2f 75 73 72 2f 6c 69 62 65 78 65 63 |al `/usr/libexec|
00000060 2f 70 61 74 68 5f 68 65 6c 70 65 72 20 2d 73 60 |/path_helper -s`|
00000070 0a 66 69 0a e2 80 a8 0a 69 66 20 5b 20 e2 80 9c |.fi.....if [ ...|
00000080 24 7b 42 41 53 48 2d 6e 6f 7d e2 80 9d 20 21 3d |${BASH-no}... !=|
00000090 20 e2 80 9c 6e 6f e2 80 9d 20 5d 3b 20 74 68 65 | ...no... ]; the|
000000a0 6e 0a 5b 20 2d 72 20 2f 65 74 63 2f 62 61 72 73 |n.[ -r /etc/bars|
000000b0 68 72 63 20 5d 20 26 26 20 2e 20 2f 65 74 63 2f |hrc ] && . /etc/|
000000c0 62 61 73 68 72 63 0a 66 69 0a |bashrc.fi.|
000000ca
It looks like some of this text was manually retyped into the editor.

The first reason I suspect this is the "/etc/bars" at the end of line 00a0, which is part of the filename "/etc/barshrc". This is wrong: there should be no 'r' between "ba" and 's'. Looking back through the OP's posts, this typo appears consistently. If he'd copied and pasted from post #8, then there should have been no opportunity for mistyping anything.

The use of "barshrc" also explains why "bashrc" wasn't being loaded.

Second, the byte sequences that begin "e2 80" are the following Unicode characters, represented as UTF-8 codes:
e2 80 a8 -- \u2028 .. line separator
e2 80 9c -- \u201c .. open curly "
e2 80 9d -- \u201d .. close curly "
How "line separator" got there is a puzzle, but may be due to conversion from RTF to plain text.

The curly quotes should not be there at all if the text was pasted into the file. Instead, this looks like it was typed in, and Smart Quotes was enabled either system-wide:
System Preferences > Language & Text > Text > Smart Quotes​
or in TextEdit's Preferences window (look for a checkbox under New Documents).

Since smart quotes should only apply to what's typed, not what's pasted, it suggests that some of the text containing quotes was typed in.

Can you write a "dummy-guide" on how to do it step-by-step? I am pretty new to the OSX-business.. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.