This ksh script seems to work with your posted data:
I don't believe that I have ever used a statement like:
if data=$(grep "^${field2}," file2.txt) ; then
before. It is a cool technique.
I'm getting to grips with this concept of the umask.
What I thought was, setting umask uga+rwx would result in creating files with all permissions for everyone. Seems not to be the case though. Read and write bits get set, but not the execute bit.
Is there some gap in my understanding, or is... (2 Replies)
Hi All,
I am trying to manipulate a text file in a csh script I am writing. I just started scripting a few months ago and have NO idea how to get this to work. My ultimate goal is to turn a text file that looks like this:
4 ep2d_diff_mddw_20_p2-MOD err 128 128 64 62 52611737
2 ... (3 Replies)
Hi everybody,
I need an urgent help with a BASH script. I have file which contains (besides the other data) the lines with the following structure identified by with keyword PCList:
<PARAMETER NAME="PCList"
TYPE="LIST_STRUCTURE"
MODEL="{,}"
... (1 Reply)
Hi,
I need a shell/command to achieve this task.
I've a delimited unloaded file from oracle in a scrambled format as shown below with many blank lines in it, I'm just trying to tailor it in a format that would be compatible to view and load it to a IDS db.
Here is the problem
... (1 Reply)
Hi Guys,
I'm really new to Unix and Linux and other scripting languages but recently I hv been really enthusiatic about learning more to help out on my work.
So I have a file with 3 columns. A sample of it looks like looks like this :
K2_537841 AAATCAGCCGCAACATTTGC ... (7 Replies)
hi
i have a file of the following format
FILE1
5 937 8
1860 1850 1
683 2 1
129 2 2
5 938 8
1122 1123 1
20 520 4
1860 1851 1
5 939 8
1122 1124 1
20 521 4i have another file which... (3 Replies)
im copying alot of files this is a script im trying to modify but not sure how to make it copy files without an extension and then add a .txt to them
abc= #assuming the file does not have an end or extension
foo='abc$'
FROM=/user/share/doc
TO=~/home/doc
for grep $foo in... (3 Replies)
Hello Experts,
I have .txt file which has various columns and 4 rows.
cat input.txt
Cont x y z k
Max 0.3 0.9 0.4 0.6
Min 0.2 0.9 0.3 0.6
Diff 0.1 0 0.1 0
Output:
Cont x y z k
Max 0.5 1.1 0.6 0.8
Min 0.1 0.7 0.2 0.4
Diff 0.4 0.4 0.4 0.4
That means if the diff between the Max and... (2 Replies)
Hi All,
I have next to zero knowledge on what I am about to ask so I will just ask it in plain English :)
I am wondering how best to go about manipulating audio files server side. The manipulations required are join files one after the other, eg, audio1 + audio2 + audio3 + audio4 = audio5
... (0 Replies)
Not sure if the question posted in another forums can be moved by me.So posting the link here.
https://www.unix.com/unix-advanced-expert-users/221425-shell-script-manipulate-files.html#post302795379
Need your help here. (1 Reply)
Discussion started by: vedanta
1 Replies
LEARN ABOUT CENTOS
reindexdb
REINDEXDB(1) PostgreSQL 9.2.7 Documentation REINDEXDB(1)NAME
reindexdb - reindex a PostgreSQL database
SYNOPSIS
reindexdb [connection-option...] [--table | -t table] [--index | -i index] [dbname]
reindexdb [connection-option...] --all | -a
reindexdb [connection-option...] --system | -s [dbname]
DESCRIPTION
reindexdb is a utility for rebuilding indexes in a PostgreSQL database.
reindexdb is a wrapper around the SQL command REINDEX(7). There is no effective difference between reindexing databases via this utility
and via other methods for accessing the server.
OPTIONS
reindexdb accepts the following command-line arguments:
-a, --all
Reindex all databases.
[-d] dbname, [--dbname=]dbname
Specifies the name of the database to be reindexed. If this is not specified and -a (or --all) is not used, the database name is read
from the environment variable PGDATABASE. If that is not set, the user name specified for the connection is used.
-e, --echo
Echo the commands that reindexdb generates and sends to the server.
-i index, --index=index
Recreate index only.
-q, --quiet
Do not display progress messages.
-s, --system
Reindex database's system catalogs.
-t table, --table=table
Reindex table only.
-V, --version
Print the reindexdb version and exit.
-?, --help
Show help about reindexdb command line arguments, and exit.
reindexdb also accepts the following command-line arguments for connection parameters:
-h host, --host=host
Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory
for the Unix domain socket.
-p port, --port=port
Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.
-U username, --username=username
User name to connect as.
-w, --no-password
Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a
.pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a
password.
-W, --password
Force reindexdb to prompt for a password before connecting to a database.
This option is never essential, since reindexdb will automatically prompt for a password if the server demands password authentication.
However, reindexdb will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to
avoid the extra connection attempt.
--maintenance-db=dbname
Specifies the name of the database to connect to discover what other databases should be reindexed. If not specified, the postgres
database will be used, and if that does not exist, template1 will be used.
ENVIRONMENT
PGDATABASE, PGHOST, PGPORT, PGUSER
Default connection parameters
This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 31.14, "Environment
Variables", in the documentation).
DIAGNOSTICS
In case of difficulty, see REINDEX(7) and psql(1) for discussions of potential problems and error messages. The database server must be
running at the targeted host. Also, any default connection settings and environment variables used by the libpq front-end library will
apply.
NOTES
reindexdb might need to connect several times to the PostgreSQL server, asking for a password each time. It is convenient to have a
~/.pgpass file in such cases. See Section 31.15, "The Password File", in the documentation for more information.
EXAMPLES
To reindex the database test:
$ reindexdb test
To reindex the table foo and the index bar in a database named abcd:
$ reindexdb --table foo --index bar abcd
SEE ALSO REINDEX(7)PostgreSQL 9.2.7 2014-02-17 REINDEXDB(1)