02-13-2012
try the below scripts. it works as you expected unless there is a space.
te4:
|
#! /bin/bash |
val=`awk '{ |
i=0 |
printf("%s ",$i) |
}' inp4` |
./te5 $val |
te5: prints the argument received
|
#! /bin/bash |
echo "val 1 $1" |
echo "val 2 $2" |
inp4: input file
Output is:
./te4
val 1 ou=x,o=z
val 2 o=y
Thanks
kalai
This User Gave Thanks to kalpeer For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Thank you very much. (2 Replies)
Discussion started by: ShellUser
2 Replies
2. UNIX for Advanced & Expert Users
Dude,
I want to kill a process, but the processid is in a text file. I have to read the text file for the process id and pass it as parameter to the kill command.
Example
$ cat prcid.txt
18650
I want to pass the value 18650 as a process id to kill command.
$ kill -9 <value read from... (4 Replies)
Discussion started by: aksmuralee
4 Replies
3. Shell Programming and Scripting
Hi,
I have a my script here--
print "The Perl Script does the User health check and system health check...\n";
print "---------------------------------------------------------------------\n";
# use strict;
my($OS);
$OS = $^O;
# need to test @ARGV before GetOptions shifts it
if (@ARGV... (1 Reply)
Discussion started by: namishtiwari
1 Replies
4. Shell Programming and Scripting
How do we pass multiple arguments into awk :
name=john
age=12
now i have to pass both age and name into awk.. how to do it?
like : awk -v var=... (4 Replies)
Discussion started by: abhinav192
4 Replies
5. Shell Programming and Scripting
How to delete both hidden (. dot files) and regular files available in a directory in a single shot (just one pass instead of two rm commands)?
The following are not helping:
rm .* (or) rm \.* (or) rm .??* (or) rm *
All these commands delete either hidden or regular files at one... (4 Replies)
Discussion started by: royalibrahim
4 Replies
6. Shell Programming and Scripting
Hi,
I have to use ksh on HP-UX for some scripting.
I usually use "set -e -u" in scripts to stop if errors occur or a typo is in a variable name.
Now I try to use "$@" to pass the arguments unchanged to another function, which works without problems - unless I try to call the script without... (7 Replies)
Discussion started by: michas
7 Replies
7. Shell Programming and Scripting
I have a task. The scenario is like this. I have a operation program (OPR1) , whose function is to simply double the (single)value it receives as input.
I have to write a script to operate the OPR1 and save its output in a file.
Later, I have to modify the script so as to be able to operate ... (0 Replies)
Discussion started by: animesharma
0 Replies
8. Shell Programming and Scripting
Hi,
I want to run a target of makfile using script by passing different arguments to it again n again. I i need to grep certain things from the log file.
eg
make abc KAB=8 BAC=8 >& KAB_BAC.log
grep "timeA" KAB_BAC.log
grep "timeB" KAB_BAC.log
(i want to store the difference of the two time... (0 Replies)
Discussion started by: vdhingra123
0 Replies
9. UNIX for Dummies Questions & Answers
Hello,
Please, how can i pass arguments to my lib.so ? my lib.so is written in c and i need some arguments in the code ..
LD_PRELOAD=lib.so ./program
Thank you. (1 Reply)
Discussion started by: chercheur857
1 Replies
10. Shell Programming and Scripting
hi,
Is it possible to pass arguments to a sftp script and use those arguments in the program?
for example
sftp_script
FILENAME=$1
#!/usr/bin/expect
spawn /usr/bin/sftp abc@ftp.abc.com
expect "abc@ftp.abc.com's password:"
send "pass\r"
expect "sftp>"
send "mput $FILENAME\r"... (9 Replies)
Discussion started by: Little
9 Replies
LEARN ABOUT CENTOS
create_foreign_table
CREATE FOREIGN
TABLE(7) PostgreSQL 9.2.7 Documentation CREATE FOREIGN TABLE(7)
NAME
CREATE_FOREIGN_TABLE - define a new foreign table
SYNOPSIS
CREATE FOREIGN TABLE [ IF NOT EXISTS ] table_name ( [
{ column_name data_type [ OPTIONS ( option 'value' [, ... ] ) ] [ NULL | NOT NULL ] }
[, ... ]
] )
SERVER server_name
[ OPTIONS ( option 'value' [, ... ] ) ]
DESCRIPTION
CREATE FOREIGN TABLE will create a new foreign table in the current database. The table will be owned by the user issuing the command.
If a schema name is given (for example, CREATE FOREIGN TABLE myschema.mytable ...) then the table is created in the specified schema.
Otherwise it is created in the current schema. The name of the foreign table must be distinct from the name of any other foreign table,
table, sequence, index, or view in the same schema.
CREATE FOREIGN TABLE also automatically creates a data type that represents the composite type corresponding to one row of the foreign
table. Therefore, foreign tables cannot have the same name as any existing data type in the same schema.
To be able to create a table, you must have USAGE privilege on all column types.
PARAMETERS
IF NOT EXISTS
Do not throw an error if a relation with the same name already exists. A notice is issued in this case. Note that there is no guarantee
that the existing relation is anything like the one that would have been created.
table_name
The name (optionally schema-qualified) of the table to be created.
column_name
The name of a column to be created in the new table.
data_type
The data type of the column. This can include array specifiers. For more information on the data types supported by PostgreSQL, refer
to Chapter 8, Data Types, in the documentation.
NOT NULL
The column is not allowed to contain null values.
NULL
The column is allowed to contain null values. This is the default.
This clause is only provided for compatibility with non-standard SQL databases. Its use is discouraged in new applications.
server_name
The name of an existing server for the foreign table.
OPTIONS ( option 'value' [, ...] )
Options to be associated with the new foreign table or one of its columns. The allowed option names and values are specific to each
foreign data wrapper and are validated using the foreign-data wrapper's validator function. Duplicate option names are not allowed
(although it's OK for a table option and a column option to have the same name).
EXAMPLES
Create foreign table films with film_server:
CREATE FOREIGN TABLE films (
code char(5) NOT NULL,
title varchar(40) NOT NULL,
did integer NOT NULL,
date_prod date,
kind varchar(10),
len interval hour to minute
)
SERVER film_server;
COMPATIBILITY
The CREATE FOREIGN TABLE command largely conforms to the SQL standard; however, much as with CREATE TABLE, NULL constraints and zero-column
foreign tables are permitted.
SEE ALSO
ALTER FOREIGN TABLE (ALTER_FOREIGN_TABLE(7)), DROP FOREIGN TABLE (DROP_FOREIGN_TABLE(7)), CREATE TABLE (CREATE_TABLE(7)), CREATE SERVER
(CREATE_SERVER(7))
PostgreSQL 9.2.7 2014-02-17 CREATE FOREIGN TABLE(7)