User Profile

Collapse

Profile Sidebar

Collapse
ciro25
ciro25
Last Activity: Jun 29 '07, 07:43 PM
Joined: Jun 13 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ciro25
    started a topic add a string in the middle of a file

    add a string in the middle of a file

    want to add a string in a very top of a file without using VI or SED or AWK
    this is what ive done:

    (echo '0a'; echo 'LINE OF TEXT'; echo '.'; echo 'wq') | ed -s myfile

    to add astrng right in the middle i could have count the lines of the file and just chenge the address.


    EG. if file has 6 lines of text:

    (echo '3a'; etc...etc...etc ...)...
    See more | Go to post

  • ciro25
    replied to search for occurrences
    This is what i mean...
    Look at this please!!!

    [ciro.ruggiero@u nix ~]$ grep $USER xx | cat -n
    1 USER=ciro.ruggi ero
    2 MAIL=/var/spool/mail/ciro.ruggiero
    3 PATH=/u01/app/oracle/product/10.2.0/db_1/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/ciro.ruggiero/bin
    4 PWD=/home/ciro.ruggiero
    5 HOME=/home/ciro.ruggiero
    6 LOGNAME=ciro.ru ggiero...
    See more | Go to post

    Leave a comment:


  • ciro25
    started a topic search for occurrences

    search for occurrences

    i ve got a file with 100 of text lines and many occurrences.
    How can i search and display them all nummbered?

    E,g:

    1) bla bla bla
    2) fortij nfhru
    3)fhdgfhdiwe

    P.s i do not want to get rid of them just output them and redirect them in another file.

    There must be a way to do it without using sed or awk isn it?

    Thnx
    See more | Go to post

  • ciro25
    replied to Shell script programming
    if i do in this way $1>>$2 the line of text would go at the end of the file and not on the top of the file.
    how about f i use -ed- editor?
    See more | Go to post

    Leave a comment:


  • ciro25
    started a topic Shell script programming

    Shell script programming

    Can anybody give me an hint on how to answer this questions?



    "For the following and any subsequent exercises you ARE NOT permitted to use either SED or AWK".

    Script 1

    Pre-requisites
    Create a file with x amount of lines in it, the content of your choice.

    Write a script that takes two arguments. The first being a line of text, the second being your newly created...
    See more | Go to post
No activity results to display
Show More
Working...