LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-15-2022, 12:57 PM   #1
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Stable {Probably forever}
Posts: 632

Rep: Reputation: 174Reputation: 174
Simple Script, two errors I Cannot Figure Out: unexpected EOF while looking for matching `'' and syntax error: unexpected end of file


*:{I had a stroke in 2011, and am "brain-damaged"}

I use Debian Testing, and before I start using aptitude, I run the following script:

The simple script, called "kev-update.bash" is:

#!/bin/bash

sudo aptitude update | tee -a update.text
sudo aptitude upgrade | tee -a update.text
sudo aptitude purge 'deborphan | tee -a update.text`

exit 0

line 5: unexpected EOF while looking for matching `''
and
line 8: syntax error: unexpected end of file

I have been using extra {return}s
I have been messing around with that whole line line with the command purge to no avail

I have used remove rather than purge to no avail.

However if I remove the the "aptitude purge" line, my problems go away.
But I would like when I do an update, I would like all unnecessary packages to removed.

Sooooo...

Question: When I do an update, I want those unnecessary packages purged. How can I do that automatically, since my script seems to be bad.

Thank you for reading this posting, and have yourself an excellent day!
 
Old 07-15-2022, 01:20 PM   #2
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
Your ' go across the pipeline.
 
Old 07-15-2022, 01:27 PM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,146

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
Backticks don't like nested operators. I think the line would work as:

sudo aptitude purge $(deborphan | tee -a update.text)
 
Old 07-15-2022, 03:06 PM   #4
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,141
Blog Entries: 6

Rep: Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828
Quote:
#!/bin/bash

sudo aptitude update | tee -a update.text
sudo aptitude upgrade | tee -a update.text
sudo aptitude purge 'deborphan | tee -a update.text`

exit 0
Quote:
line 5: unexpected EOF while looking for matching `''
and
line 8: syntax error: unexpected end of file
Tells exactly where the problem is. On line 5.

Why don't you try that.
Code:
echo 'Hello`
A single quote and a back tick.

Now try
Code:
echo 'Hello'
If you use a syntax highlighting text editor, it will point that out to you.

You can also refrain from using back ticks.
Code:
printf '%s\n' $(echo "123" | awk '/1/{print $0}')
 
Old 07-16-2022, 09:11 AM   #5
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Stable {Probably forever}
Posts: 632

Original Poster
Rep: Reputation: 174Reputation: 174
To all, especially "smallpond":

The line change to: "sudo aptitude purge $(deborphan | tee -a update.text)"

worked like a charm! Yet again, life is good.

Calling this thread as [SOLVED]

Everybody in the linuxquestions.org community, have a glorious day!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] mkinitrd_command_generator.sh "line 1: unexpected EOF while looking for matching `'' linux91 Slackware 7 05-27-2021 11:18 AM
Command line execution error: unexpected EOF while looking for matching `"' bash: -c: line 25: syntax error: unexpected end of file maheshreddy690 Linux - Newbie 1 12-25-2018 01:13 PM
[SOLVED] Script returning with error "syntax error: unexpected end of file" n_raghuvanshi Linux - Software 4 08-25-2013 08:49 AM
Unexpected EOF while looking for matching `'' in bashrc with several aliases NewTom Linux - Newbie 5 09-27-2011 04:47 PM
Backup Script error "line 31: syntax error: unexpected end of file" eswanepoel General 7 12-07-2007 09:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration