So - you want CUSTOM and three lines from that file plus an empty line presented on stdin to your script ${APPS}/kali/bin/u_tra. We are NOT talking of presenting the lines a command parameters?
Thanks for replay sorry for getting confusing
This is the main script
Below code if we will do manually pass value as per input file now we have 2 times passing the parameter while runing the script
may be will pass more then 2 times
And run the scripts
I need to write a scripts which will pick values from input file.
parameter should be pass under the EOD and missing the syntax and space also
Moderator's Comments:
Please use code tags (as required by forum rules) whenever posting sample input, output, and code segments.
Is this a homework assignment? Does your instructor require that you use a here-document to complete this assignment?
If not, why do you care whether your input data (NOT parameters; parameters are command-line arguments) is read from a pipe or from a here-document?
I might guess that RudiC's code doesn't work for you because it only invokes your application once, but since you haven't clearly described how that application works, we are still guessing at what your real requirements are.
Is there any difference in the output produced by the commands:
and the commands:
?
Did you try the code RudiC suggested, or did you just decide that it won't work without trying it?
Note that in post #1 you said that there had to be one empty line before the "EOD". In post #4 you show two examples with one empty line and one example with two empty lines. And in post #6 you show one example with two empty lines. Which examples are correct???
What exactly does:
Quote:
parameter should be pass under the EOD and missing the syntax and space also
mean? Shell command line syntax must be followed when writing shell scripts. If you leave out the syntax, the script can't work? What "space also" do you want to leave out?
Please use complete sentences when posting here, with punctuation so we can understand what you're trying to say. Please use capitalization at the start of your sentences so we can understand what you're trying to say. Please help us help you by taking the time needed to clearly explain what you are trying to do and show us examples that support the description of the problem you're trying to solve.
OS version: RHEL 6.7
myTextFile.txt file is referred within Script1.sh script,
I only execute Script1.sh and I want the input variable to be passed inside myTextFile.txt . Any idea how I can do this ?
$ cat script1.sh
cat myTextFile.txt
$ cat myTextFile.txt
$1
Requirement1.... (4 Replies)
i have a scenario where in i have to monitor jobs which run in different servers, The job details(job name, host server, etc) are present in a dat file.
I have written a script a script which reads the details from the dat file and calls a local method where the job monitoring logic is present.... (2 Replies)
Hi all ,
I want to pass contents from a file say f1 as arguments to a sql query which has In statement using a script
example
select * from table_1 where login in ( `cat f1`) ;
will this work or is there any other way to do it. (1 Reply)
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)
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)
Hi,
I am using SYBASE database. in my script i am connecting to DB via using isql.
isql -U${S_USER} -S${S_SERV} -D${S_DB} -P${S_PWD} -b0 -w3000 -h0 -s"|" -i${MYDIR}/ABC.sql -oXYZ.txt << FINSQL
i am taking a ABC.sql file to use the queries written in it and storing the output in... (3 Replies)
Hi,
i am new to awk. I am using csv2pipe script(shown below)
BEGIN { FS=SUBSEP; OFS="|" }
{
result = setcsv($0, ",")
print
}
# setcsv(str, sep) - parse CSV (MS specification) input
# str, the string to be parsed. (Most likely $0.)
# sep, the separator between the values.
#
#... (6 Replies)
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)
Hi, I am trying to write a ftp script which will read a file for filenames and ftp those files to another server. Here's my ftp script, but it's scanning the current directory for file names.
My question is how can I pass multiple files (these files will have the name of data files that need to... (0 Replies)