Sponsored Content
Full Discussion: Awk: can't open error
Top Forums Shell Programming and Scripting Awk: can't open error Post 302826281 by rangarasan on Wednesday 26th of June 2013 09:15:37 AM
Old 06-26-2013
Hey,

If you want to take the fourth part of file name, you could do something like below,

Code:
ls pay*|awk -F':' '{print $4;}'

If you want to store the output of awk to a variable, you should use like below,
Code:
variable_name=`your command goes here`

or

variable_name=$(your command goes here)

Cheers!!!
-R
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk: cannot open inputf

I'd like some help with awk too. Somewhere in my bash script i have written something like this: awk -v outputfile=$finalFile -v inputf=$file 'BEGIN { commands } { more commands } ΕND{ }' inputf where the file is a .input file with data. I also tried this: awk -v... (2 Replies)
Discussion started by: little_fairy
2 Replies

2. Shell Programming and Scripting

awk: can't open

Hi Guys, I was just trying to run a bunch of test scripts which ran perfectly before i changed servers to a different solaris machine. But i just changed it to run on a different solaris version and my awk statement in the script shows an error. awk BEGIN{s=ARGV; r=ARGV; \ ... (2 Replies)
Discussion started by: wick3dsunny
2 Replies

3. Shell Programming and Scripting

awk Can't open file

Hello all, I am creating a small bash script to cycle through some files that are the results of an analysis I have run (I am a statistician). There are many folders called job001, job002,...,job135. Each folder has a text file called results.txt. I want to create two summary files of the... (3 Replies)
Discussion started by: jem43
3 Replies

4. Shell Programming and Scripting

awk: can't open the file

I have a shell script with the following awk command. awk '$1 == "GEOG_SRV"{split($2,a,":");print a}' /etc/qm when I run it manually command line its fine and giving the output. bash-3.00$ awk '$1 == "GEOG_SRV"{split($2,a,":");print a}' /etc/qm 9010 But in the script its... (5 Replies)
Discussion started by: Tuxidow
5 Replies

5. Shell Programming and Scripting

AWK Too many open streams to print/printf

hallow all i need your advice about this script i have script like this: INDEX=/zpool1/NFS/INDEX/${1} SCRIPT=/zpool1/NFS/script/${1} LIST=SAMPLE cd ${SCRIPT} for i in `cat ${LIST}` do GETDATE=`echo ${i}|awk '{print substr($1,9,8)}'` /usr/xpg4/bin/awk -F ":" '{close(f);f=$4}{print >>... (4 Replies)
Discussion started by: zvtral
4 Replies

6. Shell Programming and Scripting

How to open large datafie in awk?

I just tried awk '{print}' all.plo awk: cannot open all.plo (Value too large for defined data type)awk '{print $8"-"$7"-"$6,$9,$4,$5,$12,$15}' all.plo awk: cannot open all.plo (Value too large for defined data type) datafile size is 4.8GB any other provision ? only cat works FS is... (4 Replies)
Discussion started by: Akshay Hegde
4 Replies

7. Shell Programming and Scripting

Awk: can't open file!!

To whom it may concern, Please help! I am trying to use awk to open all the files in a folder and remove one row and append everything into an output file. for X in `ls /Users/misssmith/Desktop/birdseed/`; do awk '(NR==546412)' /Users/misssmith/Desktop/birdseed/$X >>... (6 Replies)
Discussion started by: salpie
6 Replies

8. Shell Programming and Scripting

awk output yields error: awk:can't open job_name (Autosys)

Good evening, Im newbie at unix specially with awk From an scheduler program called Autosys i want to extract some data reading an inputfile that comprises jobs names, then formating the output to columns for example 1. This is the inputfile: $ more MapaRep.txt ds_extra_nikira_usuarios... (18 Replies)
Discussion started by: alexcol
18 Replies

9. Shell Programming and Scripting

awk date too many open files

Dear Community; I have a csv file with msb and lsb in $3 and $5 fields which provides the epochtime (factor 65536). Further I need to convert epochtime to readable datetime. But am getting an error. File Sample: 5000a,1000,20671,0,16421,0,1,NULL,0 5000b,1000,20974,0,-16284,0,1,NULL,0... (4 Replies)
Discussion started by: mystition
4 Replies

10. Shell Programming and Scripting

awk (Too many open files)

Hi Team, This is my first post, hope I am doing it right. I have a large file, like 6 GB. Its a proxy file so vendor requested to change username from logs for saving the confidentiality of the user. This is the script I created (With the help of Google): awk '{ tmp="echo " $5 " |... (12 Replies)
Discussion started by: tealc
12 Replies
Class::MOP::Package(3pm)				User Contributed Perl Documentation				  Class::MOP::Package(3pm)

NAME
Class::MOP::Package - Package Meta Object VERSION
version 2.0603 DESCRIPTION
The Package Protocol provides an abstraction of a Perl 5 package. A package is basically namespace, and this module provides methods for looking at and changing that namespace's symbol table. METHODS
Class::MOP::Package->initialize($package_name, %options) This method creates a new "Class::MOP::Package" instance which represents specified package. If an existing metaclass object exists for the package, that will be returned instead. No options are valid at the package level. Class::MOP::Package->reinitialize($package, %options) This method forcibly removes any existing metaclass for the package before calling "initialize". In contrast to "initialize", you may also pass an existing "Class::MOP::Package" instance instead of just a package name as $package. Do not call this unless you know what you are doing. Class::MOP::Package->create($package, %options) Creates a new "Class::MOP::Package" instance which represents the specified package, and also does some initialization of that package. Currently, this just does the same thing as "initialize", but is overridden in subclasses, such as "Class::MOP::Class". Class::MOP::Package->create_anon(%options) Creates a new anonymous package. Valid keys for %options are: "weaken" If this is true (the default), the instance stored in "Class::MOP"'s metaclass cache will be weakened, so that the anonymous package will be garbage collected when the returned instance goes out of scope. $metapackage->is_anon Returns true if the package is an anonymous package. $metapackage->name This is returns the package's name, as passed to the constructor. $metapackage->namespace This returns a hash reference to the package's symbol table. The keys are symbol names and the values are typeglob references. $metapackage->add_package_symbol($variable_name, $initial_value) This method accepts a variable name and an optional initial value. The $variable_name must contain a leading sigil. This method creates the variable in the package's symbol table, and sets it to the initial value if one was provided. $metapackage->get_package_symbol($variable_name) Given a variable name, this method returns the variable as a reference or undef if it does not exist. The $variable_name must contain a leading sigil. $metapackage->get_or_add_package_symbol($variable_name) Given a variable name, this method returns the variable as a reference. If it does not exist, a default value will be generated if possible. The $variable_name must contain a leading sigil. $metapackage->has_package_symbol($variable_name) Returns true if there is a package variable defined for $variable_name. The $variable_name must contain a leading sigil. $metapackage->remove_package_symbol($variable_name) This will remove the package variable specified $variable_name. The $variable_name must contain a leading sigil. $metapackage->remove_package_glob($glob_name) Given the name of a glob, this will remove that glob from the package's symbol table. Glob names do not include a sigil. Removing the glob removes all variables and subroutines with the specified name. $metapackage->list_all_package_symbols($type_filter) This will list all the glob names associated with the current package. These names do not have leading sigils. You can provide an optional type filter, which should be one of 'SCALAR', 'ARRAY', 'HASH', or 'CODE'. $metapackage->get_all_package_symbols($type_filter) This works much like "list_all_package_symbols", but it returns a hash reference. The keys are glob names and the values are references to the value for that name. Class::MOP::Package->meta This will return a Class::MOP::Class instance for this class. AUTHOR
Moose is maintained by the Moose Cabal, along with the help of many contributors. See "CABAL" in Moose and "CONTRIBUTORS" in Moose for details. COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Infinity Interactive, Inc.. 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-06-28 Class::MOP::Package(3pm)
All times are GMT -4. The time now is 03:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy