LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2013, 02:33 PM   #1
rickmike45
LQ Newbie
 
Registered: Jun 2013
Posts: 2

Rep: Reputation: Disabled
Unhappy bash: syntax error near unexpected token


Trying to update firefox and this is what I type and get. What does this mean and how can I fix it please.

[root@genesis firefox] # cp /root/Desktop/firefox-3.6.8(2).tar.bz
bash: syntax error near unexpected token '('
 
Old 06-03-2013, 02:45 PM   #2
spazticclown
Member
 
Registered: Sep 2010
Distribution: Fedora, Android, CentOS
Posts: 91
Blog Entries: 2

Rep: Reputation: 21
The command "cp" is the copy command, for that you need a source and destination specified. You only have a source "/root/Desktop/firefox-3.6.8(2).tar.bz". The copy command will not update firefox from a tarball and this version of firefox is very much out of date.

What distribution are you using, perhaps there is a build in package manager or command like yum or apt-get to update a pre-compiled version of the current firefox?
 
Old 06-03-2013, 02:57 PM   #3
rickmike45
LQ Newbie
 
Registered: Jun 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Would this work then (I know it's a very old version of firefox) and I am trying to use Fedora 18 and stay within the command line?

[root@genesis firefox] # cp /root/Desktop/firefox-3.6.8(2).tar.bz \opt\firefox
[root@genesis firefox] # tar firefox-3.6.8(2).tar.bz
 
Old 06-03-2013, 05:27 PM   #4
spazticclown
Member
 
Registered: Sep 2010
Distribution: Fedora, Android, CentOS
Posts: 91
Blog Entries: 2

Rep: Reputation: 21
Probably the best method is to use yum to update/install firefox.

Code:
# yum install firefox
as root will install firefox from the command line.

I also choose to live in the command line as much as possible, it is faster than trying to find known applications from a gui and more rewarding when something doesn't go terribly wrong.
 
Old 06-03-2013, 06:09 PM   #5
PasBern
Member
 
Registered: Dec 2009
Location: Near Frankfurt, Germany
Distribution: OpenSUSE Leap 15.5, MacOS
Posts: 122

Rep: Reputation: 2
Quote:
Originally Posted by rickmike45 View Post
[root@genesis firefox] # cp /root/Desktop/firefox-3.6.8(2).tar.bz \opt\firefox

Does that mean that you are running your desktop as root (logged in as root in the graphical login manager) and have downloaded the tar.gz file to your desktop via a browser? I'm asking because it is highly unusual to run GUI applications in whatever form or shape, be it a single program or a desktop environment, as root. From a security standpoint this is not recommended as far as I know. Please correct me somone in case I got this wrong. I do not mean to inconvenience you, it just looks strange, and as a complete newbie I have so far made many silly mistakes....
Someone could have told me
 
Old 06-03-2013, 06:39 PM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Quote:
# cp /root/Desktop/firefox-3.6.8(2).tar.bz \opt\firefox
That won't work because you are not using windows. If you changed the destination to: /opt/firefox/ it should work. Check the link below for some simple instructions on extracting a tar.bz file:

http://www.cyberciti.biz/faq/tar-extract-linux/
 
1 members found this post helpful.
Old 06-03-2013, 09:48 PM   #7
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
The '(' and ')' are illegal characters in any bash command. So any command with using this file name will throw an error. You'd have to escape:
Code:
cp foo\(bar\) baz
when you want to copy foo(bar)

jlinkels
 
1 members found this post helpful.
  


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
-bash: syntax error near unexpected token `(' akshaykb1 Linux - Newbie 3 11-21-2011 06:45 PM
[SOLVED] bash: syntax error near unexpected token `(' rc5gd Programming 6 07-13-2010 08:54 PM
[SOLVED] bash: syntax error near unexpected token `else' lucmove Programming 9 05-10-2010 09:03 PM
bash: syntax error near unexpected token `(' Folklore Linux - Newbie 1 05-02-2010 03:35 AM
-bash: syntax error near unexpected token ty1on Linux - Newbie 3 08-26-2009 02:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:52 AM.

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