How do I substitute a word throughout a file? For example change all instances of the word John to Mark. This would be in vi for korn shell. (10 Replies)
well i have this file here:
<XML>
<pregate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<system_c>HPREGATE</system_c>
<trans_c>HSPG</trans_c>
<trans_dt>20060105161333</trans_dt>
<user_id_m></user_id_m>
<func_c>C</func_c>
</pregate>
</XML>
i want to... (2 Replies)
Hello experts,
I know line number of the word I want to replace. Can "sed" substitute word on a specific line?
As well, can sed substitute words inside a specific patten.
ex. <word>lalala</word> #replace anything between <word> and </word>
minifish (2 Replies)
Hi every body!
I would like to get only filename in the result of find command in Linux but I don't know howto. Tks so much for your helps. (5 Replies)
Hi all ,
i am having a table which contains start date and end date
for ex ..
startdate enddate
12/03/2011 12/04/2012
11/03/2011 20/05/2011
11/04/2011 28/07/2011
how to grep startdate = 12/03/2011
enddate = 28/07/2011
i need output :-
startdate:12/03/2012... (4 Replies)
I am trying to do what I thought should be a simple substitution, but I can't get it to work.
File:
Desire output:
I thought I'd start with a sed command to remove the part of the header line preceding the string "comp", then go on to remove the suffix of the target string (e.g. ":3-509(-)"),... (3 Replies)
Hi all,
OS is Solaros 10 Sparc
While doing Netbackup upgradation to 7.5 , the server was asked to reboot.
But then it came up in single user mode,
and after I typed format command it showed some disk error.
bash-3.00# format
Searching for disks...WARNING:... (2 Replies)
i need to substitute word on a specific line.
I was able to do it on command line like below but it is not working in vi.
command line like below:
sed -e '8s/table_name/schema.table_name/' file_name.
in vi table_name and schema are my positional parameters that i pass into the
script.
... (5 Replies)
Team,
I want to change below parameter in all the files in a directory,
Check for HOSTNAME=`hostname`
Change to HOSTNAME=localhost
And I tried below but, its not working ☹
find /tmp -type f -exec sed 's/"HOSTNAME\=\`hostname\`"/"HOSTNAME\=localhost/g'"
Help me if I am missing... (6 Replies)
HI
I am trying to use the following code in the shell script (using grep)
usage()
{
echo "Usage: ./$0 <file name> <interval> <pattern>"
}
METRICS_FILE=$1
INTERVAL=$2
PATTERN="$3"
..
if
then
PATTERN="grep Gx"
fi
COUNT=`cat ${METRICS_FILE} | "${PATTERN}" |egrep... (8 Replies)
Discussion started by: asifansari
8 Replies
LEARN ABOUT DEBIAN
aesub
aesub(1)aesub(1)NAME
aesub - substitute and echo strings
SYNOPSIS
aesub [ option... ] string ...
aesub -Help
aesub -VERSion
DESCRIPTION
The aesub command is used to perform the usual aesub(5) substitutions on its command line arguments, and then echo them to the standard
output.
Shell Script Quoting
The aesub(1) command is often used in shell scripts. It is important to remember that the shell will do its own substitutions on the com-
mand line argument before it invokes the aesub(1) command. Usually, you don't want this to happen, so you need to use single (') quotes
to do this. (The shell continues to substitute inside double (") quotes.)
Quote aesub(1) arguments using ' single ' quotes.
OPTIONS
The following options are understood:
-BaseLine
This option may be used to specify that the project baseline is the subject of the command.
-Change number
This option may be used to specify a particular change within a project. See aegis(1) for a complete description of this option.
-File filename
Take the text to be substituted from the specified file. The filename `-' is understood to mean the standard input.
-Help
This option may be used to obtain more information about how to use the aesub program.
-Project name
This option may be used to select the project of interest. When no -Project option is specified, the AEGIS_PROJECT environment
variable is consulted. If that does not exist, the user's $HOME/.aegisrc file is examined for a default project field (see aeu-
conf(5) for more information). If that does not exist, when the user is only working on changes within a single project, the
project name defaults to that project. Otherwise, it is an error.
See also aegis(1) for options common to all aegis commands.
All options may be abbreviated; the abbreviation is documented as the upper case letters, all lower case letters and underscores (_) are
optional. You must use consecutive sequences of optional letters.
All options are case insensitive, you may type them in upper case or lower case or a combination of both, case is not important.
For example: the arguments "-project, "-PROJ" and "-p" are all interpreted to mean the -Project option. The argument "-prj" will not be
understood, because consecutive optional characters were not supplied.
Options and other command line arguments may be mixed arbitrarily on the command line, after the function selectors.
The GNU long option names are understood. Since all option names for aesub are long, this means ignoring the extra leading '-'. The
"--option=value" convention is also understood.
EXIT STATUS
The aesub command will exit with a status of 1 on any error. The aesub command will only exit with a status of 0 if there are no errors.
ENVIRONMENT VARIABLES
See aegis(1) for a list of environment variables which may affect this command. See aepconf(5) for the project configuration file's
project_specific field for how to set environment variables for all commands executed by Aegis.
SEE ALSO aesub(5)
Available string substitutions.
COPYRIGHT
aesub version 4.24.3.D001
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Peter
Miller
The aesub program comes with ABSOLUTELY NO WARRANTY; for details use the 'aesub -VERSion License' command. This is free software and you
are welcome to redistribute it under certain conditions; for details use the 'aesub -VERSion License' command.
AUTHOR
Peter Miller E-Mail: millerp@canb.auug.org.au
//* WWW: http://www.canb.auug.org.au/~millerp/
Reference Manual Aegis aesub(1)