pattern match and substitution, can you help?
file named test.txt
I want to replace all the words Event with the word Fatal in all lines containing the word ERR - but I also want to keep the output of the other lines not matching ERR
Test.txt:
Event 13 INF egegegege
Event 14 INF... (4 Replies)
Hello everyone ...
I'm going crazy, I hope some of you can help me ...
I have to replace a line in a crontab like this:
5 2 * * 2 root backupdat
with this:
5 5 * * 3 root backupdat
the command I use is the following:
sed -i.bak -e 's/5 2 * * 2 root backupdat/5 5 * * 3 root... (4 Replies)
Hi all, hoping this is a simple one, tried looking but just can't see the solution
As an example I've got a list of words that all start Ben.....
Bendicks
Benefiber
Ben
Benylin
I need to only change the line Ben with Ben 10, ignoring the other lines.
I tried the following
... (1 Reply)
Hi all,
I've been experiencing a difficulty trying to match a number and write it to a new file.
My input file is: input.txt
It contains the lines:
103P 123587.256971 3.21472112 3.1517423
1.05897234566427 58.2146258 12.35478 25.3612489
What would be the sed command to... (17 Replies)
Hi,
I would like to use SED to do the following string replacement:
asd1abc to www1cda
asd2abc to www2cda
...
asd9abc to www9cda
I can use 'asd.abc' to find the orignal string, however I don't know how to generate the target string. Any suggestion?
Thanks,
... (2 Replies)
How can I write a script that takes a cisco config file and outputs every occurrence of two, or more, pattern matches through the whole config file?
For example, out of a config file, i want to print out every line with interface, description and ip address through the whole file, and disregard... (3 Replies)
Ive used this snippet of code on a solaris box thousands of times.
But it isnt working on the new linux box
sed -n '/interface LoopBack0/{N;/ ip address /p;}' *.conf
its driving me nuts !!
Is there something Im missing ? (7 Replies)
I need to grep for the pattern text inside the square brackets which are in red and not in green..my current code greps patterns both of them, which i don't want
Input fileref|XP_002371341.1| oxoacyl-ACP reductase, putative gb|EPT24759.1| 3-ketoacyl-(acyl-carrier-protein) reductase ... (2 Replies)
Input: START
OS:: UNIX
Release: xxx
Version: xxx
END
START
OS:: LINUX
Release: xxx
Version: xxx
END
START
OS:: Windows
Release: xxx
Version: xxx
ENDHere i am trying to get all the information between START and END, only if i could match OS Type.
I can get all the data between the... (3 Replies)
Discussion started by: Dharmaraja
3 Replies
LEARN ABOUT LINUX
create_tablespace
CREATE TABLESPACE(7) SQL Commands CREATE TABLESPACE(7)NAME
CREATE TABLESPACE - define a new tablespace
SYNOPSIS
CREATE TABLESPACE tablespacename [ OWNER username ] LOCATION 'directory'
DESCRIPTION
CREATE TABLESPACE registers a new cluster-wide tablespace. The tablespace name must be distinct from the name of any existing tablespace in
the database cluster.
A tablespace allows superusers to define an alternative location on the file system where the data files containing database objects (such
as tables and indexes) can reside.
A user with appropriate privileges can pass tablespacename to CREATE DATABASE, CREATE TABLE, CREATE INDEX or ADD CONSTRAINT to have the
data files for these objects stored within the specified tablespace.
PARAMETERS
tablespacename
The name of a tablespace to be created. The name cannot begin with pg_, as such names are reserved for system tablespaces.
username
The name of the user who will own the tablespace. If omitted, defaults to the user executing the command. Only superusers can create
tablespaces, but they can assign ownership of tablespaces to non-superusers.
directory
The directory that will be used for the tablespace. The directory must be empty and must be owned by the PostgreSQL system user. The
directory must be specified by an absolute path name.
NOTES
Tablespaces are only supported on systems that support symbolic links.
CREATE TABLESPACE cannot be executed inside a transaction block.
EXAMPLES
Create a tablespace dbspace at /data/dbs:
CREATE TABLESPACE dbspace LOCATION '/data/dbs';
Create a tablespace indexspace at /data/indexes owned by user genevieve:
CREATE TABLESPACE indexspace OWNER genevieve LOCATION '/data/indexes';
COMPATIBILITY
CREATE TABLESPACE is a PostgreSQL extension.
SEE ALSO
CREATE DATABASE [create_database(7)], CREATE TABLE [create_table(7)], CREATE INDEX [create_index(7)], DROP TABLESPACE [drop_tablespace(7)],
ALTER TABLESPACE [alter_tablespace(7)]
SQL - Language Statements 2010-05-14 CREATE TABLESPACE(7)