Search Results

Search: Posts Made By: mopimp
3,069
Posted By mopimp
Get a line
Hi All,

pretty simple on, i have a text file or what ever with several lines:

one
two
three

How do i select a specific line by line number. Looked in cut and grep and cant find anything....
14,771
Posted By mopimp
thanks klashxx that was really useful
thanks
klashxx that was really useful
14,771
Posted By mopimp
hi there are easier ways.. just found this ...
hi there are easier ways..

just found this

cat /etc/passwd | awk -F ":" '{print $6}' #this displays 6th field ie home directories

awk -F\: '{print $6}' /etc/passwd |grep pauline #this...
5,410
Posted By mopimp
its ok i have solved it cat /etc/passwd |...
its ok i have solved it

cat /etc/passwd | awk -F ":" '{print $6}' #this displays 6th field ie home directories

awk -F\: '{print $6}' /etc/passwd |grep pauline #this displays pauline home...
14,771
Posted By mopimp
how to extract fields for /etc/passwd
hi,

i would like to extract the just name field from /etc/passwd file, and nothing else. ie grep pauline, and Pauline Fowler comes back.


cheeers
paul mc
14,361
Posted By mopimp
Thanks perder that was really helpful i...
Thanks perder
that was really helpful

i prefer the quicker solutions
14,361
Posted By mopimp
its ok i have solved it...... grep $USER...
its ok i have solved it......

grep $USER file>> newfile
sed = file3 | sed 'N;s/\n/\)/' # this prints number for every line....with a very nice right bracket ie 1)...
...
14,361
Posted By mopimp
how to insert a line number on every line
hi...

i have a file with data and would like to insert a number and bracket 1) ...2)
at the beginning of every successive line; to add some formatting to the text
3,294
Posted By mopimp
how to insert text using variable
Hi i have a dilemma

I need to write a script that takes two arguments. The first being a line of text, the second being a newly created file. The script should take the first argument and insert...
8,309
Posted By mopimp
insert text into the middle of a original file
how do u insert text into a specific place in a file, say the middle for example, without changing the name for that file
3,993
Posted By mopimp
thanks tmarikle
thanks tmarikle
3,993
Posted By mopimp
that worked fine to append to end of line, how...
that worked fine to append to end of line, how do you append on top of file, or in the middle say 5 lines down. Thanks for the quick response
3,993
Posted By mopimp
inserted text deleted file content
I need to add text on top of an original file, this method deleted my file and just left HELLO on top..

Any suggestions
3,993
Posted By mopimp
Write a script that takes 2 arguments
hi
i would be grateful for some help on the following q.

"Write a script that takes two arguments. The first being a line of text, the second being your newly created file. The script should...
Showing results 1 to 14 of 14

 
All times are GMT -4. The time now is 09:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy