Hi,
How to replace any character in a file with a newline character using sed ..
Ex:
To replace ',' with newline
Input:
abcd,efgh,ijkl,mnop
Output:
abcd
efgh
ijkl
mnop
Thnx in advance.
Regards,
Sasidhar (5 Replies)
Hello,
I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it:
char* getext(char *file)
{
char *extension;
int i, j;... (5 Replies)
hello everybody!
i have aproblem! i dont know how to concatenate const char* with char
const char *buffer;
char *b;
sprintf(b,"result.txt");
strcat(buffer,b);
thanx in advance (4 Replies)
hello all
i am trying to pass a argument through system function to a shell script.
#shell script echo.sh to display the string
echo $1
and the c program is.
#include<stdlib.h>
int
main()
{
const char *str = "hello all";
system("sh echo.sh str");
}
the output i... (5 Replies)
hi there !
i have exactly the same problem like this guy here
https://www.unix.com/shell-programming-scripting/127668-getting-curl-output-verbose-file.html
i am not able to save the curl verbose output..
the sollution in this thread (redirecting stderr to a file) does not work for me.... (0 Replies)
Advance Thanks.
(1) I would like to know any unix/Linux command to check EOF char in a file.
(2) Or Any way I can check a file has been reached completely at machine B from machine A. Note that machine A ftp/scp the file to machine B at unknown time. (5 Replies)
Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially):
xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’:
xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’
The same error with all c++ constructors - gcc 4.4.4.
If anyone can throw any light on... (8 Replies)
In our company we work for our customer with a job# philosophy, managing all the informations about a job in a share with directories whose name is starting with job number. Under this entry point we have a standard structure of folders, comprising a "communications" folder.
When we send emails... (0 Replies)
Pointers are seeming to get the best of me and I get that error in my program.
Here is the code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define REPORTHEADING1 " Employee Pay Hours Gross Tax Net\n"
#define REPORTHEADING2 " Name ... (1 Reply)
I am trying to modify the "corestat v1.1" code which is in Perl.The typical output of this code is below:
Core Utilization
CoreId %Usr %Sys %Total
------ ----- ----- ------
5 4.91 0.01 4.92
6 0.06 ... (0 Replies)
Discussion started by: Zam_1234
0 Replies
LEARN ABOUT MINIX
popen
POPEN(3) Library Functions Manual POPEN(3)NAME
popen, pclose - initiate I/O to/from a process
SYNOPSIS
#include <stdio.h>
FILE *popen(const char *command, const char *type)
int pclose(FILE *stream)
DESCRIPTION
The arguments to popen are pointers to null-terminated strings containing respectively a shell command line and an I/O mode, either "r" for
reading or "w" for writing. It creates a pipe between the calling process and the command to be executed. The value returned is a stream
pointer that can be used (as appropriate) to write to the standard input of the command or read from its standard output.
A stream opened by popen should be closed by pclose, which waits for the associated process to terminate and returns the exit status of the
command.
Because open files are shared, a type "r" command may be used as an input filter, and a type "w" as an output filter.
SEE ALSO pipe(2), fopen(3), fclose(3), system(3), wait(2), sh(1).
DIAGNOSTICS
Popen returns a null pointer if files or processes cannot be created, or the shell cannot be accessed.
BUGS
Buffered reading before opening an input filter may leave the standard input of that filter mispositioned. Similar problems with an output
filter may be forestalled by careful buffer flushing, for instance, with fflush, see fclose(3).
7th Edition May 15, 1985 POPEN(3)