Sponsored Content
Top Forums Shell Programming and Scripting Can't input large file to variable Post 303019246 by Corona688 on Monday 25th of June 2018 06:49:00 PM
Old 06-25-2018
You almost certainly can accomplish exactly what you want without assigning that file to a variable. Few languages but shell afford you such easy and direct methods of streaming data anywhere you want.

What exactly do you want to do? Why do you want a 5 gig variable - what will you do with it?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get variable input from a file

Hi guys, I want to input some variables from a file. I tried it with following script, for i in 1 2 3 4 do read varible1 varible2 < ddd.txt echo $varible1 $varible2 done ... (1 Reply)
Discussion started by: maheshsri
1 Replies

2. UNIX and Linux Applications

Input a variable and write to a file using awk

Hi I am trying to edit a csv file. Bacically I need to input a search variable and the value that must be changed in one of the fields corresponding to that searched variable. My csv file looks like so: 1,1A,5 1,1B,2 1,1C,3 2,2A,7 2,2B,4 2,2C,0 3,3A,1 3,3B,6 3,3C,4 I want to... (4 Replies)
Discussion started by: ladyAnne
4 Replies

3. Shell Programming and Scripting

KSH: Compare variable to $1 in an input file

Hello, I am working with KSH on AIX and I have 2 files generated from different sources... as seen below: FILE1 FILE2 AAA AAA@ABS0001C BBB BBB@ABS0003D CCC CCC@ABS0023A DDD DDD@ABC0145D EEE EEE@ABS0090A FFF FFF@ABS0002A GGG GGG@ABC0150D HHH FILE1 is main main data source,... (4 Replies)
Discussion started by: right_coaster
4 Replies

4. Shell Programming and Scripting

Find and analyze variable Strings in a large file.

Hi guys, I have multiple files (>5000) which I have in a folder. I read every file name and put it in a tmp variable "i" so that i can use it in the following task. I have a large .txt file (>50 MB) in which I want to find the variable "i" and the lines after this variable, so that I can use... (4 Replies)
Discussion started by: Ashitaka007
4 Replies

5. Shell Programming and Scripting

Reading from a File and Using as an Input variable

I need to know how the the string constant from Input File should be read and provide as input data for the script . INPUT FILE CONST VARIABLE myname=/root/dir/syslog/myname1 myname=/root/dir/syslog/myname2 myname=/root/dir/syslog/myname3 urname=/root/dir/syslog/urname1... (6 Replies)
Discussion started by: baraghun
6 Replies

6. Shell Programming and Scripting

awk built-in variable for input file

Hi guys, Does awk have a built-in variable which I can use to display the input file it's currently reading? I'm currently concatenating multiple files using awk and later on do some parsing. But for now, I want to add an extra column in the main output data file - basically putting in the... (3 Replies)
Discussion started by: Det7
3 Replies

7. Shell Programming and Scripting

Need to delete large set of files (i.e) close to 100K from a directory based on the input file

Hi all, I need a script to delete a large set of files from a directory under / based on an input file and want to redirect errors into separate file. I have already prepared a list of files in the input file. Kndly help me. Thanks, Prash (36 Replies)
Discussion started by: prash358
36 Replies

8. Shell Programming and Scripting

awk input large file

Hi...Does anyone know how to input huge file about 25 GB to awk if single file then this works awk '{print}' <hugefile suppose if have to use something like this awk FNR==NR{x=$0;next}{print $0,x}' hugefile1 hugefile2 then how to redirect ? and is there any provision to assign memory... (12 Replies)
Discussion started by: Akshay Hegde
12 Replies

9. Shell Programming and Scripting

XML variable for input in same input file

Dear All , i stuck in one problem executing xml .. i have input xml as <COMMAND name="ARRANGEMENT.WRITE" timestamp="0" so="initial"> <SVLOBJECT> <LONG name="CSP_PMNT_ID" val="-1"/> <MONEY name="CSP_CEILING" amount="0.0" currency="AUD"/> ... (6 Replies)
Discussion started by: arvindng
6 Replies

10. Shell Programming and Scripting

Checking the file depending on the input variable

Hi I have a requirement of taking time as input variable outside the script.depending on the time it will check the file output .like ./script.sh <30 min> so script.sh should run every 5 minutes ie.6 times to check the output file.Can any one please help here. (7 Replies)
Discussion started by: netdbaind
7 Replies
CGI::Application::Plugin::Config::Simple(3pm)		User Contributed Perl Documentation	     CGI::Application::Plugin::Config::Simple(3pm)

NAME
CGI::Application::Plugin::Config::Simple - Add Config::Simple support to CGI::Application SYNOPSIS
in your CGI::Application based module use CGI::Application::Plugin::Config::Simple; sub cgiapp_init { my $self = shift; #set my config file $self->config_file('myapp.conf'); # #do other stuff # } #later on in a run mode sub run_mode1 { my $self = shift; #just get a single parameter from my config file my $value = $self->config_param('my_param'); #get a parameter in a block (if using ini style files) $value = $self->config_param('my_block.my_param'); #the entire config hash reference my $config_vars = $self->config_param(); #get my Config::Simple object for direct access my $config = $self->config; } DESCRIPTION
This module acts as a plugin for Config::Simple to be easily used inside of a CGI::Application module. It does not provide every method available from Config::Simple but rather easy access to your configuration variables. It does however provide direct access to the underlying Config::General object created if you want to use it's full power. The module tries to make the getting and setting of configuration variables as easy as possible. Only three methods are exported into your CGI::Application module and they are described below. Before I wrote this module sometimes I would put my code that read in the configuration file into the cgiapp_init() or cgiapp_prerun() methods but then if I had a run mode that didn't need those config variables it was run anyway. This module helps to solve this is. The Config::Simple object is not created (and the config file is not read and parsed) until after your first call to config() or config_param() to either retrieve/set values, or get the Config::Simple object. This lazy loading idea came from Cees Hek's CGI::Application::Plugin::Session module. METHODS
config_param() This method acts as an accessor/mutator for configuration variables coming from the configuration file. This method will behave in three different ways depending on how many parameters it is passed. If 0 parameters are passed then the entire config structure will be returned as a hash ref. If 1 parameters is passed then the value of that parameter in the config file will be returned. If more than 1 parameter is passed then it will treat them as name value pairs and will set the parameters in the config file accordingly. In this case, if we successfully set the parameters then a true value will be returned. #get the complete config hash my $config_hash = $self->config_param(); #just get one config value my $value = $self->config_param($parameter); #set multiple config values my $success = $self->config_param(param1 => $value1, param2 => $value2); This method uses Config::Simple so if you are using ini-files then you can set the values of variables inside blocks as well using the '.' notation. See Config::Simple; You must set the name of the configuration file either using the config_file() method or the CGIAPP_CONFIG_FILE environment variable before calling this method or it will 'die'. config() This method will return the underlying Config::Simple object for more direct use by your application. You must set the name of the configuration file either using the config_file() method or the CGIAPP_CONFIG_FILE environment variable before calling this method or it will 'die'. my $conf = $self->config(); config_file([$file_name]) This method acts as an accessor/mutator to either get the name of the current config file or to change/initialize it. This method must be called to initialize the name of the config file before any call can be made to either config() or config_param() unless the 'CGIAPP_CONFIG_FILE' environment variable has been set. If this environment variable is set it will be used as the initial value of the config file. This is useful if we are running in a mod_perl environment when can use a statement like this in your httpd.conf file: PerlSetEnv CGIAPP_CONFIG_FILE /path/to/my/conf It is typical to set the name of the config file in the cgiapp_init() phase of your application. If a value is passed as a parameter then the config file with that name is used. It will always return the name of the current config file. #get the value of the CGIAPP_CONFIG_FILE environment variable (if there is one) #since we haven't set the config file's name with config_file() yet. my $file_name = $self->config_file(); #set the config file's name $self->config_file('myapp.conf'); #get the name of the config file $file_name = $self->config_file(); CAVEATS
The CGI::Application object is implemented as a hash and we store the variables used by this module's methods inside of it as a hash named __CONFIG_SIMPLE. If you use any other CGI::Application plugins there would be problems if they also used $self->{__CONFIG_SIMPLE} but in practice this should never actually happen. AUTHOR
Michael Peters <mpeters@plusthree.com> Thanks to Plus Three, LP (http://www.plusthree.com) for sponsoring my work on this module SEE ALSO
o CGI::Application o Config::Simple LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.4 2011-11-10 CGI::Application::Plugin::Config::Simple(3pm)
All times are GMT -4. The time now is 11:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy