I need to replace the line containing "STAGE_DB" with the line
"STAGE_DB $DB # database that contains the table being loaded ($workingDB)"
Here $DB is passed during the runtime.
How can I do this?
Thanks,
Kousikan (2 Replies)
Hi,
I have a problem. I want to use SED to replace one line with three
It looks like:
PARAM='first_line,second_line,third_line'
And in file:
blablabla
blablabla
PARAM
blablabla
blablabla
blablabla
All I want is to change this into:
blablabla
blablabla
first_line
second_line... (6 Replies)
i have few lines in a file... i am reading them in a while loop so a particular line is held is $line1.. consider a modified line is held in $line2.... i want to replace $line1 with $line2 in the same file... how to do it..?
i have come up till the below code
sed "s/$line1/$line2/g" tmpfile.sql... (5 Replies)
Hi How Are you?
I am doing fine!
I need to go now?
I will see you tomorrow!
Basically I need to replace the entire line containing "doing" with a blank line:
I need to the following output:
Hi How Are you?
I need to go now?
I will see you tomorrow!
Thanks in advance.... (1 Reply)
Hi
I have to replace a pattern found in the first uncommented line in a file. The challenge I'm facing is there are several such similar lines but I have to edit only the first uncommented line.
Eg:
#this is example
#/root/xyz:Old_Pattern
/root/xyz:Old_Pattern
/root/xyz:Old_Pattern
... (10 Replies)
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed...
I have an input file similar to:
&LOG
&LOG Part: "@DB/TC10000021855/--F"
&LOG
&LOG
&LOG Part: "@DB/TC10000021852/--F"
&LOG Cloning_Action: RETAIN
&LOG Part: "@DB/TCCP000010713/--A"
&LOG
&LOG... (5 Replies)
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
Hi all,
Let's say I have a script calling for the two variables PA_VALUE and PB_VALUE.
for pa in PA_VALUE
blah blah
do
for pb in PB_VALUE
blah blah
do
I have a text file with two columns of values for PA and PB.
14.5 16.7
7.8 9.5
5.6 3.6
etc etc
I would like to read this... (7 Replies)
I have few lines in a text file. I am trying to get the line number of uncommented line from the text file using unix shell script.
For example : I want the line number of Orange from the below text file. Here expected answer is 4 since the line 2 is commented.
Apple
#Orange
grapes
Orange (4 Replies)
Discussion started by: Brennon
4 Replies
LEARN ABOUT LINUX
chfn
CHFN(1) User Commands CHFN(1)NAME
chfn - change real user name and information
SYNOPSIS
chfn [-f full_name] [-r room_no] [-w work_ph] [-h home_ph] [-o other] [user]
DESCRIPTION
The chfn command changes user fullname, office number, office extension, and home phone number information for a user's account. This
information is typically printed by finger(1) and similar programs. A normal user may only change the fields for her own account, subject
to the restrictions in /etc/login.defs. (The default configuration is to prevent users from changing their fullname.) The superuser may
change any field for any account. Additionally, only the superuser may use the -o option to change the undefined portions of the GECOS
field.
These fields must not contain any colons. Except for the other field, they should not contain any comma or equal sign. It is also
recommended to avoid non-US-ASCII characters, but this is only enforced for the phone numbers. The other field is used to store accounting
information used by other applications.
If none of the options are selected, chfn operates in an interactive fashion, prompting the user with the current values for all of the
fields. Enter the new value to change the field, or leave the line blank to use the current value. The current value is displayed between a
pair of [ ] marks. Without options, chfn prompts for the current user account.
CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool:
CHFN_RESTRICT (string)
This parameter specifies which values in the gecos field of the /etc/passwd file may be changed by regular users using the chfn
program. It can be any combination of letters f, r, w, h, for Full name, Room number, Work phone, and Home phone, respectively. For
backward compatibility, yes is equivalent to rwh and no is equivalent to frwh. If not specified, only the superuser can make any
changes. The most restrictive setting is better achieved by not installing chfn SUID.
FILES
/etc/login.defs
Shadow password suite configuration.
/etc/passwd
User account information.
SEE ALSO chsh(1), login.defs(5), passwd(5).
User Commands 06/24/2011 CHFN(1)