LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 11-03-2003, 12:34 PM   #1
CarlosV
LQ Newbie
 
Registered: Nov 2003
Posts: 2

Rep: Reputation: 0
Unhappy error: unexpected token `newline'


Hi all,

when i run this line in shell works ok:

cat /userdir/file.conf | sed "s/100.100.100.100/200.200.200.200/g" > /userdir/file.conf1

but i want to add it in a shell script, and when i run it i got an error:

./test: line 2: syntax error near unexpected token `newline'
./test: line 2: `cat /userdir/file.conf | sed "s/100.100.100.100/200.200.200.200/g" >'


my script is this:

#!/bin/sh
cat /userdir/file.conf | sed "s/100.100.100.100/200.200.200.200/g" >
/userdir/file.conf1


i hope someone can help me finding where my error is or what i need to change to run it in a script

Thank You
Carlos V.
 
Old 11-03-2003, 12:37 PM   #2
jhorvath
Member
 
Registered: Sep 2002
Location: OH, USA
Distribution: 2.6.16-1.2096_FC5 #1
Posts: 245

Rep: Reputation: 30
move the third line to the end of the second

if it is imperitive that this line (the third one) be seperate for some reason ...you have to change it to this:

Code:
#!/bin/sh
cat /userdir/file.conf | sed "s/100.100.100.100/200.200.200.200/g" >\
/userdir/file.conf1

Last edited by jhorvath; 11-03-2003 at 12:38 PM.
 
Old 11-03-2003, 01:06 PM   #3
CarlosV
LQ Newbie
 
Registered: Nov 2003
Posts: 2

Original Poster
Rep: Reputation: 0
It works Thank You Jeremy
 
Old 05-17-2011, 04:14 AM   #4
maryamf
LQ Newbie
 
Registered: May 2011
Posts: 1

Rep: Reputation: 0
unexpected token 'newline'


when i run this lines in shell works ok:
echo "[Desktop Entry]
Type=Application
Encoding=UTF-8
Version=1.0
Name=No Name
Name[en_US]=Firefox
Exec=/home/jboss/bin/waitAndStart.sh
X-GNOME-Autostart-enabled=true" >
/home/jboss/.config/autostart/firefox.desktop
 
0 members found this post helpful.
Old 05-17-2011, 04:47 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
Don't drag up 8 year old threads. new question = new thread. Not that you've even asked a question at all.
 
  


Closed Thread

Tags
cloud, install, key, public, ssh, users


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
syntax error near unexpected token `fi' Warmduvet Programming 21 10-08-2013 11:28 AM
Authentication Token Manipulation Error manfernandez Linux - Security 10 06-06-2008 12:49 PM
Many errors when 'make'ing (example: error: syntax error before `::' token) darkblade Linux - Software 5 03-02-2005 04:00 PM
authentication token manipulation error abuelmaati Linux - Newbie 3 02-04-2005 08:21 AM
Undecodable token error ?? Thymox Linux - General 3 11-18-2002 07:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:26 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