If all you're doing is calculating the average then you don't need each input once it has been processed - just the running total and the number of inputs.
If have
var='$variable'
how can I expand $variable.
I have tried many thing like duble quotes/braces etc, but nothing worked.
I need the solution ASAP. (2 Replies)
Hi All,
Please ignore if terminology used is incorrect as I am new to Unix.
I want to create a Multi user input form which looks something like this:
ABCD TOOL
Logged User: abcd12 ... (4 Replies)
Hi, How to create array every time user input and store user input and display all array
print " Enter input "
my @input = split(' ', $input)
chmop($input = <STDIN>;
foreach ($input)
{
@array= @input;
}
print @array"\n"; (1 Reply)
Hi Dears,
I have one script to create new users with information in one plain text file. This script will read all lines in the file and create one users for one line.
Sample file:
#action;login,full name title,expire date,project
+;gmwen,Bruce Wen QA,04/01/2012,BT
+;xxdeng,Shown Deng... (4 Replies)
I want to create an array which can store the strings from the user input in shell script .
example :-
I want to store the 5 fruits name in a single array which the user provides . (1 Reply)
Hi,
I'm quite new to ksh scripting, can someone help me with this.
Requirements:
I need to create a script that list the files from a user input date range.
e. g. format of file:
*c1*log.2012-12-22-14-00*
*c1*log.2012-12-22-14-00*
*c1*log.2012-12-22-14-00*... (1 Reply)
Hi,
I need some help to setup some environmental variables.
for example...Get A -> userdefined/user input
B -> a number.
c -> system variable...for example $GETCONF PAGE_SIZE
E = do some math using bc
display a message "The value is E"
setup the system/kernel paramter sysctl -p... (3 Replies)
In the below bash a file is downloaded when the program is opened and then that file is searched based on user input and the result is written to a new file.
For example, the bash is opened and the download.txt is downloaded, the user then enters the id (NA04520). The id is used to search... (5 Replies)
I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
I am trying to create a bash script that will create new function by using the user input. The below will create the necessary files in the correct format, however when it comes to the # create function I am at a loss.
If the name entered was NEWNAME and the genes were GENE1,GENE2 then two files... (0 Replies)
Discussion started by: cmccabe
0 Replies
LEARN ABOUT DEBIAN
file::randomaccess
File::RandomAccess(3pm) User Contributed Perl Documentation File::RandomAccess(3pm)NAME
File::RandomAccess - Random access reads of sequential file or scalar
SYNOPSIS
use File::RandomAccess;
$raf = new File::RandomAccess(*FILE, $disableSeekTest);
$raf = new File::RandomAccess($data);
$err = $raf->Seek($pos);
$num = $raf->Read($buff, $bytes);
DESCRIPTION
Allows random access to sequential file by buffering the file if necessary. Also allows access to data in memory to be accessed as if it
were a file.
METHODS
new Creates a new RandomAccess object given a file reference or reference to data in memory.
# Read from open file or pipe
$raf = new File::RandomAccess(*FILE);
# Read from data in memory
$raf = new File::RandomAccess($data);
Inputs:
0) Reference to RandomAccess object.
1) File reference or scalar reference.
2) flag set if file is already random access (disables automatic SeekTest).
Returns:
Reference to RandomAccess object.
SeekTest
Performs test seek() on file to determine if buffering is necessary. If the seek() fails, then the file is buffered to allow random
access. SeekTest() is automatically called from new unless specified.
$result = $raf->SeekTest();
Inputs:
0) Reference to RandomAccess object.
Returns:
1 if seek test passed (ie. no buffering required).
Notes:
Must be called before any other i/o.
Tell
Get current position in file
$pos = $raf->Tell();
Inputs:
0) Reference to RandomAccess object.
Returns:
Current position in file
Seek
Seek to specified position in file. When buffered, this doesn't quite behave like seek() since it returns success even if you seek
outside the limits of the file.
$success = $raf->Seek($pos, 0);
Inputs:
0) Reference to RandomAccess object.
1) Position.
2) Whence (0=from start, 1=from cur pos, 2=from end).
Returns:
1 on success, 0 otherwise
Read
Read data from the file.
$num = $raf->Read($buff, 1024);
Inputs:
0) Reference to RandomAccess object.
1) Buffer.
2) Number of bytes to read.
Returns:
Number of bytes actually read.
ReadLine
Read a line from file (end of line is $/).
Inputs:
0) Reference to RandomAccess object.
1) Buffer.
Returns:
Number of bytes read.
Slurp
Read whole file into buffer, without changing read pointer.
Inputs:
0) Reference to RandomAccess object.
Returns:
Nothing.
BinMode
Set binary mode for file.
Inputs:
0) Reference to RandomAccess object.
Returns:
Nothing.
Close
Close the file and free the buffer.
Inputs:
0) Reference to RandomAccess object.
Returns:
Nothing.
AUTHOR
Copyright 2003-2011 Phil Harvey (phil at owl.phy.queensu.ca)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO Image::ExifTool(3pm)perl v5.12.4 2011-01-03 File::RandomAccess(3pm)