07-11-2007
Hi,
Thanks for your explinations
Thanks and Regards,
Mohan
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi, once again -
Ok here it is:
a).I used the touch command to create a file (touch directory.list)
b).I then added this line: - date '+The date is %a %h %d, %Y %nIt is %I:%M %p' > directory.list
-So that this date function would go at the top of my script
c).Now I want to display a... (1 Reply)
Discussion started by: Astudent
1 Replies
2. Shell Programming and Scripting
i've been fiddling around with append and I know how to append a word into a file, but how would you go about appending a word to a filename? (5 Replies)
Discussion started by: codewarrior7
5 Replies
3. Shell Programming and Scripting
Hey, I'm creating a custom useradd script, and I'm giving the option to add secondary groups. Basically what I want to do is ask for the name of the group, you type in the group you want to add, it assigns that group name to the variable $sgroup. Then the scripts asks if you want add another. If... (0 Replies)
Discussion started by: paqman
0 Replies
4. Shell Programming and Scripting
Hi all,
I have two files called INPUT1 and INPUT2 and i am trying to append the values of INPUT1 to INPUT2 using AWK.
The INPUT1 file will always has a single field and the INPUT2 file has 3 fields but both files will have same number of records always. Following is the format of the... (5 Replies)
Discussion started by: harris2107
5 Replies
5. Shell Programming and Scripting
hi All,
Searched forum but couldn't find a solution to this problem:
How can I append a file with date in the ninth line?
ie I want to insert a line with the current date and time in the ninth line.
I tried this:
date=`date`
awk 'NR==9 {printf "'$date' \n"} {print $0}' abc.log
below... (10 Replies)
Discussion started by: Sreejith_VK
10 Replies
6. Shell Programming and Scripting
Hi,
I'm having a problem with something I can't really figure out by myself. I've tried to do it with a for loop, but I'm pretty sure it won't work, if I'm not mistaken.
Basically, what I'm trying to do is test some variables and if any of them is not empty, add the values of these variables... (5 Replies)
Discussion started by: mutex1
5 Replies
7. Shell Programming and Scripting
Hi,
I have a small doubt. Here is the code snippet for which the output that I'm getting are a bit surprising.
testing.sh
#!/bin/sh
arg_1=$1
echo "arg passed by user is:${arg_1}"
mapping=`grep ${arg_1}= testing.conf | awk -F"=" '{print $2}'`
echo "mapping is $mapping"... (4 Replies)
Discussion started by: badrimohanty
4 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I just want to append the value in variable at the end of the file.
var=1234
sed -e "$a $var" file1 > file 2.
But I get this error
sed: -e expression #1, char 4: unknown command: `1'
Kindly let m know how can I do that... (5 Replies)
Discussion started by: waqar1
5 Replies
9. Shell Programming and Scripting
I have a Query!
by using command
cat >> file1 we can append data's to a already existing file, Similarly is it possible to append a data to a variable.
Thanks in Advance!! (2 Replies)
Discussion started by: gwgreen1
2 Replies
10. Shell Programming and Scripting
I have two files
FILEA
a/b/c/d
e/f/g/h
i/j/k/l
m/n/o/p
FILEB
i/j/k/l
i want that if lines of FILEB matches lines of FILEA then matching lines in FILEA to be appended by word "MATCH"
NEW FILEA
a/b/c/d
e/f/g/h
i/j/k/l "MATCH"
m/n/o/p
I have tried following script .but not... (6 Replies)
Discussion started by: shaan4uster
6 Replies
LEARN ABOUT DEBIAN
xdf_read
XDF_READ(3) xdffileio library manual XDF_READ(3)
NAME
xdf_read - Read samples from a xDF file
SYNOPSIS
#include <xdfio.h>
int xdf_read(struct xdf* xdf, unsigned int ns, ...);
DESCRIPTION
xdf_read() reads ns samples from the xDF file referenced by xdf. This file should have been opened with mode XDF_READ and xdf_pre-
pare_arrays(3) should have been successfully called on it. xdf_read() will fail otherwise).
The data to be read will be transferred into arrays specified by pointers provided in the variable list of arguments of the function. The
function expects the same number of arrays as specified by previous call to xdf_define_arrays(3). The internal organisation of the data in
the arrays should have been specified previously with calls to xdf_set_chconf(3).
In addition, it is important to note that none of the arrays should overlap.
RETURN VALUE
The function returns the number of the samples successfully read from the xDF file in case of success. The number of samples read can be
smaller than the number requested in the end of the file is reached. In case of error, -1 is returned and errno is set appropriately.
ERRORS
EINVAL xdf is NULL
EPERM No successfull call to xdf_prepare_transfer(3) have been done on xdf or it has been opened using the mode XDF_WRITE.
EINTR The call was interrupted by a signal before any data was written; see signal(7).
EIO A low-level I/O error occurred while reading from the inode.
ESTALE Stale file handle. This error can occur for NFS and for other file systems
EXAMPLE
/* Assume xdf references a xDF file opened for reading whose
channels source their data in 2 arrays of float whose strides
are the length of respectively 4 and 6 float values,
i.e. 16 and 24 bytes (in most platforms)*/
#define NS 3
float array1[NS][4], array2[NS][6];
unsigned int strides = {4*sizeof(float), 6*sizeof(float)};
unsigned int i;
xdf_define_arrays(xdf, 2, strides);
if (xdf_prepare_transfer(xdf))
return 1;
for (i=0; i<45; i+=NS) {
/* Write the values to the file */
if (xdf_write(xdf, NS, array1, array2))
return 1;
/* Use the values contained in array1 and array2*/
...
}
xdf_close(xdf);
SEE ALSO
xdf_set_chconf(3), xdf_define_arrays(3), xdf_prepare_transfer(3)
EPFL
2010 XDF_READ(3)