Linux Mint syntax error

Dat1Gamer

TS Booster
Alright guys, I was adding a line to my .profile for OpenGL to play L4D2 and after I re-booted and all of that when I log in I get this
"Your session only lasted less than 10 seconds. if you have not logged out yourself, this could mean that there is some installation problem or that you may be out of diskspace. Try logging in with one of the failsafe sessions to see if you can fix this problem.

View details (~/.xsession-errors file)
/etc/mdm/Xsession: Beginning session setup...
etc/mdm/Xsession: 25: /home/milsurp-santa/ .profile: Syntax Error Unterminated Quoted String"

Any idea what to do?
 

jobeard

TS Ambassador
Unpaired quotes and double quotes are difficult to find - - some scripting will be required.
  • cat fileName_containing_syntax_error | awk -F\" '{print $1"ZZ"$2"ZZ"$3}'
  • the \" following -F is the character that is unpaired; in this case the double quote
  • this is a pattern to format the scanning: '{print $1"ZZ"$2"ZZ"$3}'
  • if the line(s) have multiple pairs of the quote/double-quotes, then add ZZ$4ZZ$5ZZ$6
eg: for a file containing:
if [[ $1 == "--" ]]; then
the output would be
if [[ $1 == ZZ--ZZ ]]; then​

all empty lines will show as ZZZZ

and the unpaired line will look like
if [[ $1 == ZZ-- ]]; then
Then you can discard all the empty lines with egrep -v ZZZZ like this
  • cat fileName_containing_syntax_error | awk -F\" '{print $1"ZZ"$2"ZZ"$3}' | egrep -v ZZZZ
YEP! Sure gets messy :sigh:

[edit]
add NR": " to the pattern and you will see the Line Number in the file;
  • cat fileName_containing_syntax_error | awk -F\" '{print NR":- "$1"ZZ"$2"ZZ"$3}' | egrep -v ZZZZ
will produce:
  • 151:- if [[ $1 == BB-- ]]; then
[/edit]
 
Last edited:
  • Like
Reactions: MirekFe