script that produces a file according to input

Posted on 2010-01-04
Last Modified: 2013-12-26

Hi all,

I need a script (mine is not going very well) that should work like this.

1) The user inputs numbers like this (just an example the numbers will not increment like that), or they can be read from a file as well.

> 2  3

> 4  5

> 6  7

... and so  on (always two numbers per line)

2) the script shall then produce a file with the following result:

<bla ble bla0=2  bla1=4  ble0=3  ble1=5>

<bla bla bla0=4  bla1=6  ble0=5  ble1=7>

Can you see the pattern in there? I just dont know how to write the script for it, not really a script guru.

Thank you

Question by:Endelm
    LVL 84

    Accepted Solution

    read a c
    while read b d ; do
      echo "<bla ble bla0=$a  bla1=$b  ble0=$c  ble1=$d>"

    Author Comment

    Thank you a lot this works. I was trying to add something else to my script, but it has not been working. I will ask this in a new question

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now