05-31-2015
A non-existent file will be created upon redirection, i.e. both the operators > and >> will open a "fresh" file for output. Be aware that >> will append to an existing file.
touch filename will create an empty file independently.
This User Gave Thanks to RudiC For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file in multiple directory which has some records in the following format
File: a/latest.txt , b/latest.txt, c/latest.txt ->
Name=Jhon
Age=27
Gender=M
Street=LA Road
Occupation=Service
I want to generate a csv file from the above file as follows
File: output.csv ->
... (9 Replies)
Discussion started by: rjk2504
9 Replies
2. Shell Programming and Scripting
Hello forum members,
I have to create a out file in the current path./aaa/bbb/ccc/hhh.
i am writing script below.
###script Begins#####
#!/bin/ksh
echo "Weclome"
if
then
echo "Hello"
rm -rf $aaa/bbb/ccc/hhh #clean the exsisting o/p file
echo "no... (2 Replies)
Discussion started by: rajkumar_g
2 Replies
3. Shell Programming and Scripting
Hi,
I am new to Shell Scripting, and I need to create nicknames for 600 tables in db2. I have the file names in a text file and i have to pass these table names to a shell script create nicknames in db2. Can some one please help me in this regard. (1 Reply)
Discussion started by: kamalanaatha
1 Replies
4. Shell Programming and Scripting
Hi to all,
I got this content/pattern from file http.log.20110808.gz
mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1
mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU
mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Discussion started by: Mr_47
16 Replies
5. Programming
this is my issue.
4 parameters are passed from korn shell to sql script.
parameter_1= varchar2 datatype or no value entered my user.
parameter_2= number datatype or no value entered my user.
parameter_3= number datatype or no value entered my user.
parameter_4= number datatype or no... (5 Replies)
Discussion started by: megha2525
5 Replies
6. Shell Programming and Scripting
HI,
i created the below script to create the multiple files, iam not getting the required output, Please advice.
#!/bin/sh
v_date=$1 # argument will come as daymonthyear eg : 151112
v_day=`echo $v_date | cut -c 1-2`
v_mon=`echo $v_date | cut -c 3-4`
v_year=`echo $v_date | cut -c 5-6`... (4 Replies)
Discussion started by: jagguvarma
4 Replies
7. Shell Programming and Scripting
Hi,
I am trying to write a shell script which can read folder names from a text file and then go to the folder and picks up a xml file and write on my sipp script so that I can run the sipp script.
For example:
I have a text file called thelist.txt where I have provided all the folders... (7 Replies)
Discussion started by: pm1504
7 Replies
8. UNIX for Dummies Questions & Answers
Hi,
i have shell script which compiles n number of test cases and execute them one by one. i want to create report in excel through script in which two columns namely "test id" and "release".second column have two subcolumns namely compiles and excutes. so i want first column should display test... (15 Replies)
Discussion started by: RamMore123
15 Replies
9. Shell Programming and Scripting
Hi All,
I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them
abc.sh
----------
export Numbr_Parms=$#
export a=1
while
do
export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
10. Shell Programming and Scripting
I have a script, which is checking if file exists and move it to another directory
if
then
mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly
mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly
... (9 Replies)
Discussion started by: digioleg54
9 Replies
LEARN ABOUT SUSE
ipc::run::io
IPC::Run::IO(3) User Contributed Perl Documentation IPC::Run::IO(3)
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.12.1 2010-04-01 IPC::Run::IO(3)