03-31-2011
Hey thanks so much it worked.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm not very familiar with the ssh command. When I tried to set a variable and then echo its value on a remote machine via ssh, I found a problem. For example,
$ ITSME=itsme
$ ssh xxx.xxxx.xxx.xxx "ITSME=itsyou; echo $ITSME"
itsme
$ ssh xxx.xxxx.xxx.xxx 'ITSME=itsyou; echo $ITSME'
itsyou
$... (3 Replies)
Discussion started by: password636
3 Replies
2. Shell Programming and Scripting
Hi guys, I have a sed line in double quotes which works fine, but I want it to be in single quotes
here is the sed line
sed "/abc_def/s/\'.*\'/\'\${abc_def}\'/"
can some one give the equivalent to the above script in single quotes
Thanks a ton (5 Replies)
Discussion started by: sol_nov
5 Replies
3. UNIX for Dummies Questions & Answers
Unix superusers,
I am new to unix but would like to learn more about grep. I am very familiar with regular expressions as i have used them for searching text files in windows based text editors. Since I am not very familiar with Unix, I dont understand when one should use GREP with the... (2 Replies)
Discussion started by: george_vandelet
2 Replies
4. Shell Programming and Scripting
Hi,
Trying to change the prompt. I have the following code.
export PS1='
<${USER}@`hostname -s`>$ '
The hostname is not displayed
<abc@`hostname -s`>$ uname -a
AIX xyz 1 6 00F736154C00
<adcwl4h@`hostname -s`>$
If I use double quotes, then the hostname is printed properly but... (3 Replies)
Discussion started by: bobbygsk
3 Replies
5. Shell Programming and Scripting
Hi Froum.
I have tried in vain to find a solution for this problem - I'm trying to replace any double quotes within a quoted string with a single quote, leaving everything else as is.
I have the following data:
Before:
... (32 Replies)
Discussion started by: pchang
32 Replies
6. Shell Programming and Scripting
Hi All,
I'm unable to load the data using sql loader where there are double quotes within the double quotes As these are optionally enclosed by double quotes.
Sample Data :
"221100",138.00,"D","0019/1477","44012075","49938","49938/15043000","Television - 22" Refurbished - Airwave","Supply... (6 Replies)
Discussion started by: mlavanya
6 Replies
7. Shell Programming and Scripting
Hi All,
I have my data like below
"1","abc,db","hac,aron","4","5"
Now I need to extract 1,2,4th columns
Output should be like
"1",abc,db","4"
Am trying to use cut command but not able to get the results.
Thanks in advance. (4 Replies)
Discussion started by: weknowd
4 Replies
8. Shell Programming and Scripting
Hi Experts,
I am beginner to the shell scripting, My requirement is to append double quotes for each column in a file if double quotes does not exist.
Example:
"abc"|123|"gh-ch"|23.067
Use code tags, thanks. (10 Replies)
Discussion started by: spidy
10 Replies
9. UNIX for Beginners Questions & Answers
Hi,
I've a requirement like, in a csv file of 30+ fields where all the columns are having double quotes I need to remove the double quotes from certain fields and certain field should remain as it is.
Eg:... (6 Replies)
Discussion started by: Krishnanth S
6 Replies
10. Shell Programming and Scripting
Please use code tags
Hi,
I have input data is below format and n of column in the multiple flat files. the string data has any double quotes(") values replaced to double double quotes for all the columns{"").
Also, my input flat file each column string data has carriage of new line too.... (14 Replies)
Discussion started by: SSrini
14 Replies
IO::Wrap(3) User Contributed Perl Documentation IO::Wrap(3)
NAME
IO::Wrap - wrap raw filehandles in IO::Handle interface
SYNOPSIS
use IO::Wrap;
### Do stuff with any kind of filehandle (including a bare globref), or
### any kind of blessed object that responds to a print() message.
###
sub do_stuff {
my $fh = shift;
### At this point, we have no idea what the user gave us...
### a globref? a FileHandle? a scalar filehandle name?
$fh = wraphandle($fh);
### At this point, we know we have an IO::Handle-like object!
$fh->print("Hey there!");
...
}
DESCRIPTION
Let's say you want to write some code which does I/O, but you don't want to force the caller to provide you with a FileHandle or IO::Handle
object. You want them to be able to say:
do_stuff(*STDOUT);
do_stuff('STDERR');
do_stuff($some_FileHandle_object);
do_stuff($some_IO_Handle_object);
And even:
do_stuff($any_object_with_a_print_method);
Sure, one way to do it is to force the caller to use tiehandle(). But that puts the burden on them. Another way to do it is to use
IO::Wrap, which provides you with the following functions:
wraphandle SCALAR
This function will take a single argument, and "wrap" it based on what it seems to be...
o A raw scalar filehandle name, like "STDOUT" or "Class::HANDLE". In this case, the filehandle name is wrapped in an IO::Wrap
object, which is returned.
o A raw filehandle glob, like "*STDOUT". In this case, the filehandle glob is wrapped in an IO::Wrap object, which is returned.
o A blessed FileHandle object. In this case, the FileHandle is wrapped in an IO::Wrap object if and only if your FileHandle class
does not support the "read()" method.
o Any other kind of blessed object, which is assumed to be already conformant to the IO::Handle interface. In this case, you just
get back that object.
If you get back an IO::Wrap object, it will obey a basic subset of the IO:: interface. That is, the following methods (note: I said
methods, not named operators) should work on the thing you get back:
close
getline
getlines
print ARGS...
read BUFFER,NBYTES
seek POS,WHENCE
tell
NOTES
Clearly, when wrapping a raw external filehandle (like *STDOUT), I didn't want to close the file descriptor when the "wrapper" object is
destroyed... since the user might not appreciate that! Hence, there's no DESTROY method in this class.
When wrapping a FileHandle object, however, I believe that Perl will invoke the FileHandle::DESTROY when the last reference goes away, so
in that case, the filehandle is closed if the wrapped FileHandle really was the last reference to it.
WARNINGS
This module does not allow you to wrap filehandle names which are given as strings that lack the package they were opened in. That is, if a
user opens FOO in package Foo, they must pass it to you either as "*FOO" or as "Foo::FOO". However, "STDIN" and friends will work just
fine.
VERSION
$Id: Wrap.pm,v 1.2 2005/02/10 21:21:53 dfs Exp $
AUTHOR
Primary Maintainer
David F. Skoll (dfs@roaringpenguin.com).
Original Author
Eryq (eryq@zeegee.com). President, ZeeGee Software Inc (http://www.zeegee.com).
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
Around line 212:
'=item' outside of any '=over'
perl v5.16.2 2005-02-10 IO::Wrap(3)