can someone tell me how can I insert a word in front of each line in a file.
i tried with sed but didn't managed yet.
Is there another command or this one(sed) works?
10x anyway.
what have you tried exactly?
i've tried
sed i \ txtinsert filename
sed 's/^/newBeginning/' filename
could u pls expain to me what means the expr 's/^/newBeginning/' ?
doing 'man sed' yields:
s/regular expression/replacement/flags
____________________________________________________________
Substitute the replacement string for
instances of the regular expression in the
pattern space. Any character other than
backslash or newline can be used instead of a
slash to delimit the RE and the replacement.
Within the RE and the replacement, the RE del-
imiter itself can be used as a literal charac-
ter if it is preceded by a backslash.
____________________________________________________________
An ampersand (&) appearing in the replacement
will be replaced by the string matching the
RE. The special meaning of & in this context
can be suppressed by preceding it by
backslash. The characters \n, where n is a
digit, will be replaced by the text matched by
the corresponding backreference expression.
For each backslash (\) encountered in scanning
replacement from beginning to end, the follow-
ing character loses its special meaning (if
any). It is unspecified what special meaning
is given to any character other than &, \ or
digits.
s/^/newBeginning/
's' - substitute
'^' - beginning of the line
10x a lot for help
an awk solution