Sponsored Content
Top Forums Shell Programming and Scripting removing the "\" and "\n" character using sed or tr Post 302248384 by newbie_coder on Friday 17th of October 2008 12:54:54 PM
Old 10-17-2008
i figured out the file redirection... i didn't realize filename was the input file... thanks again!
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

3. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

4. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

7. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
IPC::Run::IO(3pm)					User Contributed Perl Documentation					 IPC::Run::IO(3pm)

NAME
IPC::Run::IO -- I/O channels for IPC::Run. SYNOPSIS
NOT IMPLEMENTED YET ON Win32! Win32 does not allow select() on normal file descriptors; IPC::RUN::IO needs to use IPC::Run::Win32Helper to do this. use IPC::Run qw( io ); ## The sense of '>' and '<' is opposite of perl's open(), ## but agrees with IPC::Run. $io = io( "filename", '>', $recv ); $io = io( "filename", 'r', $recv ); ## Append to $recv: $io = io( "filename", '>>', $recv ); $io = io( "filename", 'ra', $recv ); $io = io( "filename", '<', $send ); $io = io( "filename", 'w', $send ); $io = io( "filename", '<<', $send ); $io = io( "filename", 'wa', $send ); ## Handles / IO objects that the caller opens: $io = io( *HANDLE, '<', $send ); $f = IO::Handle->new( ... ); # Any subclass of IO::Handle $io = io( $f, '<', $send ); require IPC::Run::IO; $io = IPC::Run::IO->new( ... ); ## Then run(), harness(), or start(): run $io, ...; ## You can, of course, use io() or IPC::Run::IO->new() as an ## argument to run(), harness, or start(): run io( ... ); DESCRIPTION
This class and module allows filehandles and filenames to be harnessed for I/O when used IPC::Run, independent of anything else IPC::Run is doing (except that errors & exceptions can affect all things that IPC::Run is doing). SUBCLASSING
INCOMPATIBLE CHANGE: due to the awkwardness introduced in ripping pseudohashes out of Perl, this class no longer uses the fields pragma. SUBROUTINES
new I think it takes >> or << along with some other data. TODO: Needs more thorough documentation. Patches welcome. filename Gets/sets the filename. Returns the value after the name change, if any. init Does initialization required before this can be run. This includes open()ing the file, if necessary, and clearing the destination scalar if necessary. open If a filename was passed in, opens it. Determines if the handle is open via fileno(). Throws an exception on error. open_pipe If this is a redirection IO object, this opens the pipe in a platform independent manner. close Closes the handle. Throws an exception on failure. fileno Returns the fileno of the handle. Throws an exception on failure. mode Returns the operator in terms of 'r', 'w', and 'a'. There is a state 'ra', unlike Perl's open(), which indicates that data read from the handle or file will be appended to the output if the output is a scalar. This is only meaningful if the output is a scalar, it has no effect if the output is a subroutine. The redirection operators can be a little confusing, so here's a reference table: > r Read from handle in to process < w Write from process out to handle >> ra Read from handle in to process, appending it to existing data if the destination is a scalar. << wa Write from process out to handle, appending to existing data if IPC::Run::IO opened a named file. op Returns the operation: '<', '>', '<<', '>>'. See "mode" if you want to spell these 'r', 'w', etc. binmode Sets/gets whether this pipe is in binmode or not. No effect off of Win32 OSs, of course, and on Win32, no effect after the harness is start()ed. dir Returns the first character of $self->op. This is either "<" or ">". poll TODO: Needs confirmation that this is correct. Was previously undocumented. I believe this is polling the IO for new input and then returns undef if there will never be any more input, 0 if there is none now, but there might be in the future, and TRUE if more input was gotten. AUTHOR
Barrie Slaymaker <barries@slaysys.com> TODO
Implement bidirectionality. perl v5.14.2 2012-01-16 IPC::Run::IO(3pm)
All times are GMT -4. The time now is 07:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy