08-11-2008
I didn't know you were allowed to do stuff like that with file handles. Does it help if you upgrade to File::IO objects instead? They're supposed to make stuff like this doable without resorting to deep voodoo and hoping the symbol table stays sane.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have gone to /usr/bin/ and click on perl but notting happens.also notting happens when i click on c/c++ or any other program
whats wrong ? (2 Replies)
Discussion started by: perleo
2 Replies
2. Shell Programming and Scripting
Hello,
I need to print messages both to screen and to file handle in perl , like tee does in unix .
Any suggestions ?
Thanks (2 Replies)
Discussion started by: Alalush
2 Replies
3. Shell Programming and Scripting
Hi All,
I need some expert help in performing the following in Perl.
I have a code below but it doesn;t seem to work. Can any expert give me some advice?
Below are the requirements
1) Open numerous files assigned to an array @FILES. Note that the files are always named with the term... (7 Replies)
Discussion started by: Raynon
7 Replies
4. Shell Programming and Scripting
Hi All,
I have a total of ten file to open in the Perl script and i am using a for loop to open each file and capture some strings inside each file.
Unfortunately, i encounter the below syntax error.
I think there should be something wrong with this term reports_${counting}_${_}.txt but i do... (4 Replies)
Discussion started by: Raynon
4 Replies
5. Shell Programming and Scripting
Hi Guru's,
Pardon me for the breach of rules.....
I have very little knowledge about Shell Programming and Scripting hope you guys help me out of this troble
I have very little time hence could not find the right way to direct my queries.
coming to the problem
I need to call a... (2 Replies)
Discussion started by: saikrishna_tung
2 Replies
6. Shell Programming and Scripting
Good morning guys!!
Im still practicing with Perl and now Im trying to open a file, and copy its contents to another file. Them I want to remeove the information out of the orginal file after it is copied over.
The flow should be messages-->messages1-->messages2.
Kind of like a log... (1 Reply)
Discussion started by: bigben1220
1 Replies
7. Programming
Hi,
i have run the below perl code and i am getting an error
Error:readline() on closed filehandle OR at run.pl line 31.
CODE:
===========================================
open OR,$ARGV;
while (<OR>) { # find the batch date
next if length $_ < 3; # BLANK LINE
# last if $. > 120; #... (3 Replies)
Discussion started by: pspriyanka
3 Replies
8. UNIX for Dummies Questions & Answers
Hi I need to open a file if a condition(for example a if a regular expression) is met. How do i do this ?
open (file) if (some regex)..... (3 Replies)
Discussion started by: manutd
3 Replies
9. Shell Programming and Scripting
Hi
we have one function which is used to append data the file in exclusive lock mode in aperl script.
This script is executed by multiple threads at the same time.
accessing the same file.this script runs throught the day.
sometimes the file2.txt size is getting reduced.
for eg from 10 M... (1 Reply)
Discussion started by: Shahul
1 Replies
10. Shell Programming and Scripting
Hello friends,
i have a perl script as below ...
for (0 ..$#values)
{
##want to print some message here in Report.txt file
print `find /abc/xyz/pqr/$values" -type f -ls` >> Report.txt
}
I am able to get output of print `find /abc/xyz/pqr/$values" -type f -ls` >> Report.txt
in... (2 Replies)
Discussion started by: harpal singh
2 Replies
shift(1) User Commands shift(1)
NAME
shift - shell built-in function to traverse either a shell's argument list or a list of field-separated words
SYNOPSIS
sh
shift [n]
csh
shift [variable]
ksh
* shift [n]
DESCRIPTION
sh
The positional parameters from $n+1 ... are renamed $1 ... . If n is not given, it is assumed to be 1.
csh
The components of argv, or variable, if supplied, are shifted to the left, discarding the first component. It is an error for the variable
not to be set or to have a null value.
ksh
The positional parameters from $n+1 $n+1 ... are renamed $1 ..., default n is 1. The parameter n can be any arithmetic expression that
evaluates to a non-negative number less than or equal to $#.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not
performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
csh(1), ksh(1), sh(1), attributes(5)
SunOS 5.10 15 Apr 1994 shift(1)