Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

please advice

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

example

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

.

more file

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

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

Questions on Server Fault are expected to relate to professional 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.

2 Answers 2

up vote 1 down vote accepted

try

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?

IP_INFO=12.23.2.1
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
1  
@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.