LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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

Reply
 
Search this Thread
Old 03-23-2011, 10:47 AM   #1
moata_u
Member
 
Registered: Jan 2011
Posts: 32

Rep: Reputation: 0
Lightbulb ed command problem


i have write the following script :
Code:
ed -s application.properties << EOF
  g/=rmi\\\\:\/\/[^\]*/s||=rmi\\\\://$host_ip|
  w
EOF
and that's work perfectly when i run it in terminal ...
i saved that script in a file, when i try run that file i always got the following error : unexpected end of file ....?? it seems i need to add quot , slash ...`` , '' ....am not sure i have tried nothing work !!

any idea ??

Last edited by moata_u; 03-23-2011 at 10:49 AM.
 
Old 03-23-2011, 11:16 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
You need a q command so that ed quits. It is expecting further input, which could come from stdin in this case.

You could probably use:
ed -s application.properties < edcommands

Instead of a HERE document, if this is the entire script.

Last edited by jschiwal; 03-23-2011 at 06:41 PM. Reason: correction: << edcommands -> < edcommands
 
Old 03-23-2011, 03:09 PM   #3
moata_u
Member
 
Registered: Jan 2011
Posts: 32

Original Poster
Rep: Reputation: 0
Code:
You could probably use:
ed -s application.properties << edcommands
i already tried that , but does not work as well....
 
Old 03-23-2011, 06:41 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
I made a mistake. Use "ed -s application.properties <edcommands"
First add the 'q' command to the end of ed.commands so that ed quits.

I'll edited my previous message.

Last edited by jschiwal; 03-23-2011 at 06:42 PM.
 
  


Reply

Tags
bash scripting


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
[SOLVED] rm command problem eparl Linux - Newbie 6 02-19-2011 03:05 PM
problem with auditreduce command and praudit command preetishetty Linux - Security 0 12-03-2007 09:24 AM
A tr command problem baks Programming 10 05-31-2007 08:03 AM
at Command Problem BBPS Linux - Software 2 09-06-2006 06:23 AM
problem in cp command ksriram03 Linux - Newbie 2 03-15-2006 12:12 PM


All times are GMT -5. The time now is 12:46 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration