Writing a UNIX shell script to call a C function and redirecting data to a .txt file
Hi, I am complete new to C programming and shell scripting. I just wrote a simple C code to calculate integral using trapezoid rule. I am prompting user to pass me No. of equally spaced points , N , upper and lower limit. My code looks as follows so far:
Now, I want to write a unix script which calls the program for N = 2^{i} for integers i from 1, 2, 3, ..., 20 and use the Unix redirect operator > to record this data in a file.
I am searching over internet how to pass argument through shell and even how to modify my code so that it reads that passed parameter, still no good answer. Your suggestions are highly appreciated. It will help me learn the unix shell scripting as well.
i have a function written in one shell script and i want to call that function in another shell script and use the value returned by that script.
can any one suggest me how can i do that?
regards,
Rajesh.P (4 Replies)
Hi,
I am looking for the unix script which can takes the 2 month old data from a TXT file (there is one txt file in whiche messages are appended on daily basis) and compress them into new file.Please halp me out. (2 Replies)
Here is the following code :
1.
# gcc -c test firstprog.c
the above command will generate a executable file called "test " in which ever directory it is run.
Assuming It will also return a value.
2. In the below SCRIPT . test is a file generated by compiling a c program... (3 Replies)
Hi Experts,
can guide how we can Update a Database Table using a txt file source Using
Unix Shell Scripts.
What are the Cron Jobs codes can written to Update DB table.
txt file contains record like data.
US 09/03/2012 User DocType DocID.
these above feilds in txt files need to be updated in... (4 Replies)
Ok hope my vocab is right here, i'm trying to write multiple sets of arguments to another file for example:
I have a script that accepts four arguments and sends them to a another file
$write.sh it then out in
so the file receiver.txt would contain this:
it then out in
what... (2 Replies)
I am getting Segmentation fault at below function call in my script:
get_x() {
sqlplus -s / <<end | grep KEEP | sed 's/KEEP//;s///g'
select 'KEEP' ,table_name from all_synonyms where upper(synonym_name)= '$1';
exit
end
x=$(get_x $1)
echo " SQL OUTPUT IS :: $x"
}
I am getting output of... (1 Reply)
Hi,
I need help in writing a shell script which can read data from a text file (Cancel_ID.txt) and then calls sqlplus session (Cancel.sql) with the first line parameter of the text file ("0322600453") till all rows are not completed.
... (4 Replies)
I am converting shell script to Perl. In shell I have a code
parse_prog_args()
{
if
then
while
do
case $1 in
-P* | -p* )
export PROCESS_DATE=$2
export MM=`echo $2 | cut -c5-6`
export DD=`echo $2 | cut -c7-8`
export YY=`echo $2 | cut -c3-4`
export... (4 Replies)
i have written my shell script in notepad however i am struggling to pass the data file to be read to the script the data file is of .txt format. My target is to run the shell script from the terminal and pass 3 arguments e.g. polg@DESKTOP-BVPDC5C:~/CS1420/coursework$ bash valsplit.sh input.txt... (11 Replies)
Discussion started by: Gurdza32
11 Replies
LEARN ABOUT ULTRIX
spline
spline(1g)spline(1g)Name
spline - interpolate smooth curve
Syntax
spline [option...]
Description
The command takes pairs of numbers from the standard input as abcissas and ordinates of a function. It produces a similar set, which is
approximately equally spaced and includes the input set, on the standard output. The cubic spline output has two continuous derivatives,
and a sufficient number of points to look smooth when plotted.
Options
The following options are recognized, each as a separate argument.
-a Supplies abcissa automatically and uses specified number (next argument) for spacing. Default is 1.
-k Sets the boundary constant to the specified value (next argument). By default k = 0. For example,
(2nd deriv. at end) = k*(2nd deriv. next to end)
-n Uses specified number (n) in calculating intervals between lower and upper limits. (Default n = 100.)
-p Periodically produces output (matches derivates at ends). First and last input values should normally agree.
-x Uses specified numbers (next arguments) as lower and upper limits. Normally these limits are calculated from the data. Automatic
abcissas start at lower limit (default 0).
Restrictions
A limit of 1000 input points is enforced silently.
Diagnostics
When data is not strictly monotone in x, reproduces the input without interpolating extra points.
See Alsograph(1g), plot(1g)spline(1g)