Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

please advice

what need to change in the perl syntax in order to add new empty line after the last line?


    echo IP= |  perl  -pe "s/$/$IP_INFO/" 1>>file


more file

IP=    <-- last line
share|improve this question

closed as off topic by Michael Hampton, Sven, dunxd, mulaz, MDMarra Feb 11 '13 at 14:21

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted


echo IP= |  perl  -pe "s/$/$IP_INFO\n/" 1>>file
share|improve this answer
I copied it from question (like pkhamre I think) and I added \n. – Laurentiu Roescu Feb 11 '13 at 8:17

Why not just do it with another shell command?

echo IP= |  perl  -pe "s/$/$IP_INFO/" 1>>file
echo >> file
share|improve this answer
not good it must be as part of perl one liners command , I ask to change the perl command not add echo commnad – yael Feb 11 '13 at 7:55
@yael okay, sorry for trying to help you find a solution. – pkhamre Feb 11 '13 at 7:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.