02-26-2009
File already exists error while using '>' operator
hi
i am using the below code
grep -v '^$' file1.lst >file1.lst
but it gives file1.lst already exists.
And i want to over rite on the same file
Whats the work around?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
It is erroring for : binary operator expected on the
if line.
Any suggestions?
Thanks in advence. (7 Replies)
Discussion started by: apps_user
7 Replies
2. UNIX for Dummies Questions & Answers
Hi
I am doing a script like
if
then
echo "table name dosent exist"
exit
fi
the problem is if $table_name is null then i am getting the error
Please help me
Thanks in advance (2 Replies)
Discussion started by: ssuresh1999
2 Replies
3. Shell Programming and Scripting
Hi,
I'm new to UNIX, at least shell programming and am having trouble figuring out a problem i'm having. In one section in my nested if statement, i want the program to test if the file does not exist, based on an argument supplied at the command line by the user. What i have is
elif ; then... (3 Replies)
Discussion started by: rowlf
3 Replies
4. UNIX for Dummies Questions & Answers
find . -name "*.*"|xargs grep WT:DBF_WL>> $F
Wfexist=`cat $F|grep $i`
echo $Wfexist
if ;
then
echo $Wfexist
echo "Workflow Exist"
else
touch $O
chmod 777 $O
echo $Wfexist
echo $WfExist >> $O
fi
I am getting the error that -ne: unary operator expected in the line with red... (2 Replies)
Discussion started by: ritu.s
2 Replies
5. UNIX for Dummies Questions & Answers
Why am I getting this error.... #!/bin/sh
# iOS-Ad-Remover
# Marshall Ford @ marshallbford@gmail.com
# This project is hosted @ http://ios-ad-
# remover.sourceforge.net
# Under the GNU GPL open source license
clear
echo
if ; then echo "You need to be root to run this script."; exit 0; #... (24 Replies)
Discussion started by: mbf123
24 Replies
6. Shell Programming and Scripting
Hi
#Testing for file existence
if ; then
echo 'SCHOOL data is available for processing'
else
echo 'SCHOOL DATA IS NOT AVAILABLE FOR PROCESSING'
:
i wrote a script, where it begins by checking if file exists or not.
If it exists, it truncates the database... (2 Replies)
Discussion started by: rxg
2 Replies
7. UNIX for Dummies Questions & Answers
Basically, I want to copy all files (F03*) in this directory and merge/paste them into a new file (called SMER_2.03.12.SPU), yet the error message is "no such file or directory." I listed what is in my working directory, and the files do exist, so I'm not sure what's going on. The code's at the... (8 Replies)
Discussion started by: ucsdee
8 Replies
8. Shell Programming and Scripting
Hello Unix forum.
I'm encountering the following error "binary operator expected error" and I cannot seem to solve the issue.
I have the following source files to process:
CPA_LOOKUP_dat.lst
PROFILE_TXN__dat.lst
TRANSACTION_CODE_dat.lst
PROFILE_TXN_OUT_OF_BALANCE_dat.lst ... (2 Replies)
Discussion started by: pchang
2 Replies
9. Shell Programming and Scripting
Hi,
I wrote a function for the first time and not able to get the desired result.
I have requirement to execute 10 queries. For this i wrote a function like below.
function Command {
typeset var SOL;
if ; then CONNECTION="${CONNECTION} -e -time";
else SOL="`nzsql ${CONNECTION} -c... (8 Replies)
Discussion started by: Samah
8 Replies
10. Programming
hi,
I defined my own String class and overloaded the output operator with
friend ostream& operator<<(ostream& os, const myString& str);
//overloads the << operator so it can be used to output values of type myString
which works fine. Until I try to execute the following statement:
// +... (6 Replies)
Discussion started by: milhan
6 Replies
LEARN ABOUT DEBIAN
chi::driver::rawmemory
CHI::Driver::RawMemory(3pm) User Contributed Perl Documentation CHI::Driver::RawMemory(3pm)
NAME
CHI::Driver::RawMemory - In-process memory cache that stores direct references
VERSION
version 0.54
SYNOPSIS
use CHI;
my $hash = {};
my $cache = CHI->new( driver => 'RawMemory', datastore => $hash );
my $cache = CHI->new( driver => 'RawMemory', global => 1 );
DESCRIPTION
This is a subclass of CHI::Driver::Memory that stores references to data structures directly instead of serializing / deserializing. This
makes the cache faster at getting and setting complex data structures, but unlike most drivers, modifications to the original data
structure will affect the data structure stored in the cache, and vica versa. e.g.
my $cache = CHI->new( driver => 'Memory', global => 1 );
my $lst = ['foo'];
$cache->set('key' => $lst); # serializes $lst before storing
$cache->get('key'); # returns ['foo']
$lst->[0] = 'bar';
$cache->get('key'); # returns ['foo']
my $cache = CHI->new( driver => 'RawMemory', global => 1 );
my $lst = ['foo'];
$cache->set('key' => $lst); # stores $lst directly
$cache->get('key'); # returns ['foo']
$lst->[0] = 'bar';
$cache->get('key'); # returns ['bar']!
CONSTRUCTOR OPTIONS
Same as CHI::Driver::Memory.
SIZE AWARENESS
For the purpose of size-awareness, all items count as size 1 for this driver. (Because data structures are not serialized, there's no good
way to determine their size.)
# Keep a maximum of 10 items in cache
#
my $cache = CHI->new( driver => 'RawMemory', datastore => {}, max_size => 10 );
ACKNOWLEDGEMENTS
Thanks to Yuval Kogman whose Cache::Ref inspired me to do this.
SEE ALSO
CHI::Driver::Memory, CHI
AUTHOR
Jonathan Swartz <swartz@pobox.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-05-30 CHI::Driver::RawMemory(3pm)