Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

arguments

  • 21-08-2007 7:52pm
    #1
    Closed Accounts Posts: 91 ✭✭


    Ok so i had to create a file and put some random text into it which i did.

    THen u make a script which takes 2 arguments.

    The first being a line of text, the second being your newly created file.

    Can I just use a read the first line in using echo?

    The script should take the first argument and insert it into the very top (the first line) of the file named in your second argument.

    How do I do the second bit, it keeps putting the first argument at the bottom of the file.


Comments

  • Technology & Internet Moderators Posts: 28,830 Mod ✭✭✭✭oscarBravo


    Homework?


  • Closed Accounts Posts: 91 ✭✭magnia


    have to learn unix for a job im applying for


  • Closed Accounts Posts: 91 ✭✭magnia


    ive got this so far

    BUFF=$(cat $2) echo $1 >> $2 echo " $BUFF" >> $2

    but im getting the wrong output

    "Seamus Heaney was born in April 1939, the eldest member of a family which would eventually contain nine children.


    unixisbrillant echo"

    i need to get the lastline at the top


Advertisement