10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies
2. Shell Programming and Scripting
i had requirement like i need to get "error" line of above 3 and below 3 from a file .I tried with the below script.But it's not working.
y='grep -n -i error /home/file.txt|cut -c1'
echo $y
head -$y /home/file.txt| tail -3 >tmp.txt
tail -$y /home/file.txt head -3 >>tmp.txt (4 Replies)
Discussion started by: bhas85
4 Replies
3. Shell Programming and Scripting
Hi,
I am trying to write a script where I need to pull any file if the date is from yesterday. Can you please help me on how to check the dates for the files on the remote server?
Please let me know for any questions.
Thanks
Ajay (4 Replies)
Discussion started by: ajayakunuri
4 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I want to fetch the files based on .done file and display the .csv files and Wil take .csv files for processing.
1.I need to display the .done files from the directory.
2.next i need to search for the .Csv files based on .done file.then move .csv files for the one directory
... (2 Replies)
Discussion started by: girija.g6
2 Replies
5. Shell Programming and Scripting
Hi all,
I have two files, chap.txt and complex.txt.
chap.txt looks like this:
a
d
l
m
r
k
complex.txt looks like this:
a c d e l m n j
a d l p q r
c p r m
......... (7 Replies)
Discussion started by: AshwaniSharma09
7 Replies
6. Shell Programming and Scripting
Hello,
I try to script something (bash-script) and can not find a way to get and store a match into a variable from a line in a file. grep isn't useful as the matches are not returned - just colored. I can't get 'expr' to work for me. Is it necessary to use a perl-script with regex instead?
... (7 Replies)
Discussion started by: daWonderer
7 Replies
7. UNIX for Dummies Questions & Answers
I am using grep to match a pattern, but the output is strange.
$ grep -r -o "pattern" *
Gives me:
Binary file foo1 matches
Binary file foo2 matches
Binary file foo3 matches
To find the lines before/after, I then have to use the following on each file:
$ strings foo1 | grep -A1 -B1... (0 Replies)
Discussion started by: chipperuga
0 Replies
8. UNIX for Dummies Questions & Answers
unix program to which a directory name will be passed as
parameter. This directory will contain files with various
extensions. This script will create directories with the names of the
extention of the files and then put the files in the
corresponding folder. All files which do not have any... (2 Replies)
Discussion started by: Deekay.p
2 Replies
9. Shell Programming and Scripting
Hi
I have files with names that contain the date in several formats as, YYYYMMDD, DD-MM-YY,DD.MM.YY or similar combinations.
I know if a file fits in one pattern or other, but i donīt know how to extract the substring contained in the file that matches the pattern.
For example, i know that
... (1 Reply)
Discussion started by: pjrm
1 Replies
10. Shell Programming and Scripting
Hi, im have log file ~100000 lines,
192.168.29.1 at 10/08/09 13:58:55
192.168.60.1 at 10/08/09 14:11:28
192.168.58.171 at 10/08/09 14:12:45
192.168.61.12 at 10/08/09 14:15:44
192.168.60.1 at 10/08/09 14:16:36
192.168.60.1 at 10/08/09 14:17:43
192.168.61.12 at 10/08/09 14:18:08... (9 Replies)
Discussion started by: Trump
9 Replies
CREATE
EXTENSION(7) PostgreSQL 9.2.7 Documentation CREATE EXTENSION(7)
NAME
CREATE_EXTENSION - install an extension
SYNOPSIS
CREATE EXTENSION [ IF NOT EXISTS ] extension_name
[ WITH ] [ SCHEMA schema_name ]
[ VERSION version ]
[ FROM old_version ]
DESCRIPTION
CREATE EXTENSION loads a new extension into the current database. There must not be an extension of the same name already loaded.
Loading an extension essentially amounts to running the extension's script file. The script will typically create new SQL objects such as
functions, data types, operators and index support methods. CREATE EXTENSION additionally records the identities of all the created
objects, so that they can be dropped again if DROP EXTENSION is issued.
Loading an extension requires the same privileges that would be required to create its component objects. For most extensions this means
superuser or database owner privileges are needed. The user who runs CREATE EXTENSION becomes the owner of the extension for purposes of
later privilege checks, as well as the owner of any objects created by the extension's script.
PARAMETERS
IF NOT EXISTS
Do not throw an error if an extension with the same name already exists. A notice is issued in this case. Note that there is no
guarantee that the existing extension is anything like the one that would have been created from the currently-available script file.
extension_name
The name of the extension to be installed. PostgreSQL will create the extension using details from the file
SHAREDIR/extension/extension_name.control.
schema_name
The name of the schema in which to install the extension's objects, given that the extension allows its contents to be relocated. The
named schema must already exist. If not specified, and the extension's control file does not specify a schema either, the current
default object creation schema is used.
Remember that the extension itself is not considered to be within any schema: extensions have unqualified names that must be unique
database-wide. But objects belonging to the extension can be within schemas.
version
The version of the extension to install. This can be written as either an identifier or a string literal. The default version is
whatever is specified in the extension's control file.
old_version
FROM old_version must be specified when, and only when, you are attempting to install an extension that replaces an "old style" module
that is just a collection of objects not packaged into an extension. This option causes CREATE EXTENSION to run an alternative
installation script that absorbs the existing objects into the extension, instead of creating new objects. Be careful that SCHEMA
specifies the schema containing these pre-existing objects.
The value to use for old_version is determined by the extension's author, and might vary if there is more than one version of the
old-style module that can be upgraded into an extension. For the standard additional modules supplied with pre-9.1 PostgreSQL, use
unpackaged for old_version when updating a module to extension style.
NOTES
Before you can use CREATE EXTENSION to load an extension into a database, the extension's supporting files must be installed. Information
about installing the extensions supplied with PostgreSQL can be found in Additional Supplied Modules.
The extensions currently available for loading can be identified from the pg_available_extensions or pg_available_extension_versions system
views.
For information about writing new extensions, see Section 35.15, "Packaging Related Objects into an Extension", in the documentation.
EXAMPLES
Install the hstore extension into the current database:
CREATE EXTENSION hstore;
Update a pre-9.1 installation of hstore into extension style:
CREATE EXTENSION hstore SCHEMA public FROM unpackaged;
Be careful to specify the schema in which you installed the existing hstore objects.
COMPATIBILITY
CREATE EXTENSION is a PostgreSQL extension.
SEE ALSO
ALTER EXTENSION (ALTER_EXTENSION(7)), DROP EXTENSION (DROP_EXTENSION(7))
PostgreSQL 9.2.7 2014-02-17 CREATE EXTENSION(7)