0

My bashrc files is read but is not interpreted correctly.

qwul@qwul-ThinkPad-L440:~$ cat .bashrc
#PS1='\[\e[1;32m\]\][\W]\$\[\[\e[0m\]\]\] '
alias la="ls -a"
#alias ll="ls -l"
qwul@qwul-ThinkPad-L440:~$ appres xterm
xterm*borderWidth:      0
xterm*font:     *-fixed-*-*-*-18-*
xterm*selectToClipboard:        true
*customization: -color
qwul@qwul-ThinkPad-L440:~$ la
's: invalid option -- '
Try 'ls --help' for more information.

The PS1 setting if enabled, starts text from first column, overwriting prompt.

Copy pasting PS1 and alias works as expected from CLI.

4
  • which OS are you using ? I have no problem in ubuntu.
    – Archemar
    Jul 24, 2015 at 8:54
  • ubuntu 14.04 LTS.
    – Zxcv Mnb
    Jul 24, 2015 at 9:10
  • your config should work, try to run dos2unix .bashrc
    – Archemar
    Jul 24, 2015 at 9:19
  • Answer your own question if you found the solution.
    – theoden8
    Jul 25, 2015 at 18:15

1 Answer 1

0

dos2unix .bashrc , as suggested by Archemar worked.

From http://www.cs.toronto.edu/~krueger/csc209h/tut/line-endings.html

DOS uses carriage return and line feed ("\r\n") as a line ending, which Unix uses just line feed ("\n"). You need to be careful about transferring files between Windows machines and Unix machines to make sure the line endings are translated properly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .