08-04-2009
store the output of "find" command in a variable?
I intend to find the path/full location of a file(filename given by user thru "read filenme") using "find" or any other command and then store it's output in a variable for some other processing.
But struggling to put all things together (i.e finding the fully qualified location of that file and then storing the result in a variable).
Thnx in anticipation of help
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi guy,
I have a problem to pass a variable containing '*' value to FIND command.
below is the script. It doesn't work by submit below command:
rmf.sh name '*.txt'
or
rmf.sh name *.txt
I've tried either optn="-name '$2'" or optn="-name $2"., and there is no luck.
### (script... (5 Replies)
Discussion started by: unxuser
5 Replies
2. Shell Programming and Scripting
Dear friends,
please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories..
it is like this,
current directory contains
file1, file2, file3, dir1, dir2
and dir1 conatins
file4, file5
and dir2 contains
file6,... (9 Replies)
Discussion started by: swamymns
9 Replies
3. Shell Programming and Scripting
Hi All,
I need to store the real seconds of the following command in a variable. How could it be done?
time $(dd if=/dev/zero of=/dev/sda1 bs=512 count=2048;sync)
Thanks,
Amio (12 Replies)
Discussion started by: amio
12 Replies
4. Shell Programming and Scripting
Hello All
Nice to meet you all here in this forum,
it's my 1rst time here
i'm asking about a little issue that i face
i added a ksh script that echo " please insert your name " and store the output to a login.log file.
the script is working fine with normal telnet
but Xstart is not working... (8 Replies)
Discussion started by: islam.said
8 Replies
5. UNIX for Dummies Questions & Answers
When I do a listing in one particular directory (ls -al) I get:
total 43456
drwxrwxrwx 2 root root 4096
drwxrwxrwx 3 root root 4096
-rwxrwxr-x 1 nobody nobody 3701594
-rwxrwxr-x 1 nobody nobody 3108510
-rwxrwxr-x 1 nobody nobody 3070580
-rwxrwxr-x 1 nobody nobody 3099733
-rwxrwxr-x 1... (1 Reply)
Discussion started by: proactiveaditya
1 Replies
6. Shell Programming and Scripting
Hi,
I'm new here. I was wondering why I can't store a host lookup in a variable.
for line in $(< blacklist)
do
STOREIP=host $line;
if ]; then
$line >> blacklist2;
else
$line >> blacklist3;
fi
done
Result: "ip" command not found .. so how would I store the host lookup in the... (2 Replies)
Discussion started by: sOliver
2 Replies
7. Shell Programming and Scripting
Hi all,
I am new to Linux/shell scripting having moderate knowledge.
In my script, I need to get execution time of a command (say 'ls') in mili seconds level. For this i tried using "time" command to retrieve the total execution time in milli seconds. But, the problem is that, how to save... (9 Replies)
Discussion started by: happening_linux
9 Replies
8. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
9. Shell Programming and Scripting
Hi All,
I need to get the version of python installed and store it in a variable for later use. Whereas it is printing on the console instead of storing to variable. I am able to store output of ls command in a variable. Please check the below code :
root@myhost:/volumes/srini# cat... (4 Replies)
Discussion started by: srinivasan.neel
4 Replies
10. UNIX for Beginners Questions & Answers
I'm trying to find out what happened to the rogue game that apt-get told me it installed, so I thought I would find the file. I went to the root and entered:
find -name "rog*.*"
I get a large number of lines saying my access is denied in various directories. I figure I'll practice my Unix... (14 Replies)
Discussion started by: arghvark
14 Replies
LEARN ABOUT REDHAT
pg_config
PG_CONFIG(1) PostgreSQL Client Applications PG_CONFIG(1)
NAME
pg_config - retrieve information about the installed version of PostgreSQL
SYNOPSIS
pg_config { --bindir | --includedir | --includedir-server | --libdir | --pkglibdir | --configure | --version }...
DESCRIPTION
The pg_config utility prints configuration parameters of the currently installed version of PostgreSQL. It is intended, for example, to be
used by software packages that want to interface to PostgreSQL to facilitate finding the required header files and libraries.
OPTIONS
To use pg_config, supply one or more of the following options:
--bindir
Print the location of user executables. Use this, for example, to find the psql program. This is normally also the location where
the pg_config program resides.
--includedir
Print the location of C header files of the client interfaces.
--includedir-server
Print the location of C header files for server programming.
--libdir
Print the location of object code libraries.
--pkglibdir
Print the location of dynamically loadable modules, or where the server would search for them. (Other architecture-dependent data
files may also be installed in this directory.)
--configure
Print the options that were given to the configure script when PostgreSQL was configured for building. This can be used to repro-
duce the identical configuration, or to find out with what options a binary package was built. (Note however that binary packages
often contain vendor-specific custom patches.)
--version
Print the version of PostgreSQL and exit.
If more than one option (except for --version) is given, the information is printed in that order, one item per line.
NOTES
The option --includedir-server is new in PostgreSQL 7.2. In prior releases, the server include files were installed in the same location as
the client headers, which could be queried with the --includedir. To make your package handle both cases, try the newer option first and
test the exit status to see whether it succeeded.
In releases prior to PostgreSQL 7.1, before the pg_config came to be, a method for finding the equivalent configuration information did not
exist.
HISTORY
The pg_config utility first appeared in PostgreSQL 7.1.
SEE ALSO
PostgreSQL Programmer's Guide
Application 2002-11-22 PG_CONFIG(1)