04-11-2009
comment text in a file
Hello folks
Hope all are fine, I have query need suggestion, if these lines two lines are already commeted no need to do anything, one more thing order of alpha, gama may be different.
I have a two lines in a file data.txt
%checksum
alpha gama beta penta hexa
I want to do comment both lines so, files should looks like
#%checksum
# alpha gama beta penta hexa
waiting for nice suggestions.
Thanks,
Bash
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi I need to add a comment line at the begining of a text file. The scenario is given below.
1. The number of servers that needs to be updated is around 80
2. The location of the text file in all the servers are the same including the file name.
3. The comment has to be added at the very... (2 Replies)
Discussion started by: orakhan
2 Replies
2. UNIX for Dummies Questions & Answers
test compare shown]
Replace this text with #test compare shown] (1 Reply)
Discussion started by: manoj.b
1 Replies
3. Shell Programming and Scripting
Hi. Is there any way to make sudo always prompt for a comment (requirement) before proceding with the actions? (4 Replies)
Discussion started by: th1amigo
4 Replies
4. Shell Programming and Scripting
Legends,
Please help me out to come out of below situation.
I have a file ABC.txt with the following entries. (example below. actual entries are more than 200 lines)
PM3_fun
PM4_fun
FIMr_mrg ... (5 Replies)
Discussion started by: sdosanjh
5 Replies
5. Shell Programming and Scripting
Hello,
Be indulgent for my english.
Can you help me ?
function f1 {
}
egrep -v '^#' list_file \
| while read arg1 arg2 arg3 arg4; do
f1 $arg1 $arg2 $arg3 $arg4
done
In list_file there is
I want to replace list_file by a $var
then when i launch the script with a file's... (13 Replies)
Discussion started by: amazigh42
13 Replies
6. UNIX for Dummies Questions & Answers
Legends,
Can you please help me in following.
I need to comment lines from “/tmp/a.txt” from the line A to line B through the command prompt only.
Please use variables not direct values like 2 or 5
It can be done with VI editor but it's not matches with my requirement (: 2,5 s/^/#/g).
... (1 Reply)
Discussion started by: sdosanjh
1 Replies
7. Shell Programming and Scripting
Platform : RHEL 5.4
I have several .sql files in a directory. I want to comment lines 10 to 25 for all .sql files.
How can I do this ?
The symbol for comment in SQL is --
eg:
-- select salary from emp where empname = 'URS' ; (3 Replies)
Discussion started by: omega3
3 Replies
8. Shell Programming and Scripting
Hi,
I need to comment out (insert # in the front of a line) a line that has entry Defaults requiretty using command-line as I need to do this on hundreds of servers.
From
Defaults requiretty
To
#Defaults requiretty
I tried something like below but no luck: Please advise,... (3 Replies)
Discussion started by: prvnrk
3 Replies
9. Shell Programming and Scripting
I want to search for a block of text in httpd.conf that between two strings and comment it. There are multiple blocks with "<Directory.. and </Directory>"
<Directory "${ORACLE_INSTANCE}/config/${COMPONENT_TYPE}/${COMPONENT_NAME}/htdocs">
#
# Possible values for the Options directive are... (3 Replies)
Discussion started by: kchinnam
3 Replies
10. Shell Programming and Scripting
Dear Gurus,
I have a file which comes every day with set of data, as a part of processing i want to add a comment at the start of every line.
e.g of file
<PCL>
2E;"HCA";"COP Car A";"ODBS_CFG"
7C;"DD";"Doors Car D";"ODBS_CFG"
3D;"XA";"Auxiliary Car A";"ODBS_CFG"
3E;"XB";"Auxiliary... (12 Replies)
Discussion started by: guddu_12
12 Replies
LEARN ABOUT REDHAT
slagtm
SLAGTM(l) ) SLAGTM(l)
NAME
SLAGTM - perform a matrix-vector product of the form B := alpha * A * X + beta * B where A is a tridiagonal matrix of order N, B and X
are N by NRHS matrices, and alpha and beta are real scalars, each of which may be 0., 1., or -1
SYNOPSIS
SUBROUTINE SLAGTM( TRANS, N, NRHS, ALPHA, DL, D, DU, X, LDX, BETA, B, LDB )
CHARACTER TRANS
INTEGER LDB, LDX, N, NRHS
REAL ALPHA, BETA
REAL B( LDB, * ), D( * ), DL( * ), DU( * ), X( LDX, * )
PURPOSE
SLAGTM performs a matrix-vector product of the form B := alpha * A * X + beta * B where A is a tridiagonal matrix of order N, B and X are N
by NRHS matrices, and alpha and beta are real scalars, each of which may be 0., 1., or -1.
ARGUMENTS
TRANS (input) CHARACTER
Specifies the operation applied to A. = 'N': No transpose, B := alpha * A * X + beta * B
= 'T': Transpose, B := alpha * A'* X + beta * B
= 'C': Conjugate transpose = Transpose
N (input) INTEGER
The order of the matrix A. N >= 0.
NRHS (input) INTEGER
The number of right hand sides, i.e., the number of columns of the matrices X and B.
ALPHA (input) REAL
The scalar alpha. ALPHA must be 0., 1., or -1.; otherwise, it is assumed to be 0.
DL (input) REAL array, dimension (N-1)
The (n-1) sub-diagonal elements of T.
D (input) REAL array, dimension (N)
The diagonal elements of T.
DU (input) REAL array, dimension (N-1)
The (n-1) super-diagonal elements of T.
X (input) REAL array, dimension (LDX,NRHS)
The N by NRHS matrix X. LDX (input) INTEGER The leading dimension of the array X. LDX >= max(N,1).
BETA (input) REAL
The scalar beta. BETA must be 0., 1., or -1.; otherwise, it is assumed to be 1.
B (input/output) REAL array, dimension (LDB,NRHS)
On entry, the N by NRHS matrix B. On exit, B is overwritten by the matrix expression B := alpha * A * X + beta * B.
LDB (input) INTEGER
The leading dimension of the array B. LDB >= max(N,1).
LAPACK version 3.0 15 June 2000 SLAGTM(l)