Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Please help me in taking the values from a file Post 302222450 by jin on Wednesday 6th of August 2008 11:18:42 PM
Old 08-07-2008
Question Please help me in taking the values from a file

i have a script, whcih takes values from a file and assign it to one variable. this text value contains name of few object. value contains line by lie. i.e. one after another.

when i am assaign the value of this text file to a variable, it accept the value as one liner instead of one by one. pls help me in this.


#!/bin/bash
exclude="`cat /tmp/excludejobs`"
echo $exclude > /tmp/testexclude
find /home/bosuser/Production/jil/* | xargs grep /home/bosuser|cut -d "." -f1|cut -d "/" -f6|uniq > /tmp/includejob
job="`cat /tmp/includejob`"
echo $job > /tmp/testinclude

for i in $job
do

if [ $i != $exclude ]
then
anjil -sd $job > /tmp/document
cat /tmp/documnet | grep 'Team Mail Alias' > /tmp/rawmail
cat /tmp/rawmail | cut -d ":" -f2 > /tmp/mailalias
/usr/ucb/mail -s "notification" xx@yyyyy.com
fi


here the value takes as one liner instead of one by one.

in csh sheel we have "foraech" command but in bash how can i fullfill this

Last edited by DukeNuke2; 08-07-2008 at 02:23 AM.. Reason: changed email
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

taking a part from file name

hi i have a file with name "CT_Thread_Trace.384.20080728-121217.log" i need 384 , can any one help thanks Satya (5 Replies)
Discussion started by: Satyak
5 Replies

2. Shell Programming and Scripting

Taking a particular attribute's value in a file...

HI, Iam new to scripting..I need some guidance for invoking the following logic.. My input file contains Event Time = Thu, Nov 6, 2008 08:41:56 AM Probable Cause = UnspecifiedReason Specific Problems = BTS down due to Tx ... (16 Replies)
Discussion started by: Llb
16 Replies

3. Shell Programming and Scripting

taking the Log2 values

Hi, I am able to take the log value for the third column of a file using the script below. But I want to take the log2 (not the log). How would I write that? thanks awk 'BEGIN {OFS="\t"} {print $1, $2, log ($3)}' (2 Replies)
Discussion started by: kylle345
2 Replies

4. Shell Programming and Scripting

How to ftp multiple files by taking the file name from a input file.

Hi, I'm working on a script which has to copy multiple files from one server to another server. The list of files that are to be copied is present in a file say input.txt. vi input.txt abc.c welcome.c new.c welcome1.c for ftp'ing a single file say 'new.c' the following code... (2 Replies)
Discussion started by: i.srini89
2 Replies

5. Shell Programming and Scripting

Taking sum up all values inside the file

Hi, Taking sum up all values inside the file by using the below command: paste -sd+ filenmae | bc Getting some error like "0705-001: building space exceeded on line1 stdin" The original data looks like SPACE SPACE SPACE 0.123 JOBNAME1 SPACE SPACE 20.325 JOBNAME2 SPACE SPACE... (2 Replies)
Discussion started by: NareshN
2 Replies

6. Shell Programming and Scripting

Installing a bin file by taking input from a properties file

I need to install a bin file in UNIX which requires user interaction for giving some information like user id , path, sid etc. All these information is stored in a properties file in the same location. So if i give ./file.bin -f propfile.properties will it install the file taking all the... (1 Reply)
Discussion started by: coolmohere
1 Replies

7. UNIX for Dummies Questions & Answers

Taking word count from file and printing in file

hi, i am having a file which contains the below content, i need to take the word count of if and print the file name also inputfile.txt file_name1.txt,type_name1.txt file_name2.txt,type_name2.txt i would need the word count of the files like this if file_name*.txt then wc -l... (10 Replies)
Discussion started by: rohit_shinez
10 Replies

8. Shell Programming and Scripting

Replace from taking from file

Hi, I have one file. S_CHAR.cfg. Content given below. \" abcd1234 \| abcd1235 \$ abcd1236 So it has two record per line delimited by space. No I am looking for some help on how to replace this special charaters ( mentioned in record 1 of each line) with the values mentioned in... (7 Replies)
Discussion started by: Anupam_Halder
7 Replies

9. Shell Programming and Scripting

Search pattern in a file taking input from another file

Hi, Below is my requirement File1: svasjsdhvassdvasdhhgvasddhvasdhasdjhvasdjsahvasdjvdasjdvvsadjhv vdjvsdjasvdasdjbasdjbasdjhasbdasjhdbjheasbdasjdsajhbjasbjasbhddjb svfsdhgvfdshgvfsdhfvsdadhfvsajhvasjdhvsajhdvsadjvhasjhdvjhsadjahs File2: sdh hgv I need a command such that... (8 Replies)
Discussion started by: imrandec85
8 Replies

10. Shell Programming and Scripting

Taking key values from one file and extracting values from another file

Hi, I have two files with values in both. File1: cat 2 3 dog 4 5 elephant 6 7 camel 2 3 File2: ----+--gkf;ajf= ---+---- +----- cat -------=----+ 3 | 4 ----- dog ------++-- 5 | 9 ----++-- elephant | 5 | 7 ---++ camel ------ ++++_---- || 8 | 9 I want the final file as: cat 4... (1 Reply)
Discussion started by: npatwardhan
1 Replies
PCP.CONF(5)							File Formats Manual						       PCP.CONF(5)

NAME
pcp.conf - the Performance Co-Pilot configuration and environment file SYNOPSIS
/etc/pcp.conf DESCRIPTION
When using Performance Co-Pilot (PCP) tools and utilities and when calling PCP library functions, a standard set of environment variables are defined in /etc/pcp.conf. These variables are generally used to specify the location of various PCP pieces in the file system and may be loaded into shell scripts by sourcing the /etc/pcp.env(5) shell script and queried by C/C++ programs using the pmGetConfig(3) library function. If a variable is already defined in the environment, the values in pcp.conf do not override those values, i.e. the values in pcp.conf serve as installation defaults only. Both the pcp.env and pcp.conf files are expected to be found in /etc by default. If required, the pcp.conf file may be relocated and PCP_CONF set in the environment to specify the full path to the new location. The pcp.env file can not be relocated (this is the only hard coded path required by PCP). The syntax rules for pcp.conf are as follows : 1. the general syntax is PCP_VARIABLE_NAME=variable value to end of line 2. lines that begin with # and all blank lines are ignored. 3. all variables must be prefixed with PCP_. This is a security issue - variables that do not have this prefix will be silently ignored. 4. there should be no space between the variable name and the literal = and no space between the = and the variable value (unless the value actually starts with a space). This is required because the pcp.conf file may be sourced directly by Makefiles as well as inter- preted by the pcp.env script and the pmGetConfig function. 5. variable values may contain spaces and should not be quoted. The pcp.env script automatically quotes all variable values from the character immediately following the = through to the end of the line. For further details and an explanation of the use of each variable, see the comments in the /etc/pcp.conf file itself. ENVIRONMENT
The PCP_CONF environment variable specifies an alternative path to the pcp.conf file. SEE ALSO
PCPIntro(1), PCPIntro(3), PMAPI(3), pmGetConfig(3) and pcp.env(5). Performance Co-Pilot PCP PCP.CONF(5)
All times are GMT -4. The time now is 02:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy