I have this command, which counts number of lines in a specific file and then prints it on screen.
I would like to have the output put into a variable, but can't seem to find the correct argument for it.
How do I manage that ?
Thanks in advance
Moderator's Comments:
Please use CODE tags. It makes code, input & output/errors so much easier to read and preserves critical spacing
Last edited by rbatte1; 08-05-2014 at 10:42 AM..
Reason: Spelling and CODE tags
I do a lot of command line scripting to capture data from files or other command output. I've checked in a number of Unix and scripting books but for the life of me I can't find out how to asign field data from nawk output into variables that I can manipulate later. For example, reading a two... (6 Replies)
Hello friends,
I doing the follwing script , but found problem to store it to a shell variable.
#! /bin/sh
for temp in `find ./dat/vector/ -name '*.file'`
do
echo $temp
nawk -v temp=$temp 'BEGIN{ split(temp, a,"\/"); print a}'
done
output:
./dat/vector/drf_all_002.file... (6 Replies)
Hello,
I'm trying to assign a numeric value that is returned from one of my programs to a variable in tcsh. I want to do:
@ r10 = './my_prog file 35'
where ./my_prog file 35 returns a decimal value, but this doesn't work. How do I achieve the desired result?
Janet (4 Replies)
This is probably a simple one for the wise.
I have just started using a coprocess (first time) in order to facilitate telnet'ing from inside a shell script. It's working, but when I run a remote command I need to get the output into a local variable, but alas my kung-fu is weak.
#!... (10 Replies)
Hi all
i have 2 input files
1st file is
N1 | N2|N3|N4|N5|N6|N7|N8|N9
4041491000|245160|1|0|0|1|0|0|0
4041401505|152178|1|1|1|1|0|0|0
4041450004|014052|1|1|1|1|0|0|0
4041450005|580916|1|1|1|1|0|0|0
4041491000|230990|1|0|1|1|0|0|0
4041460001|338317|1|1|1|1|0|0|0
2nd file
N1 |... (8 Replies)
Hello,
There is pipe chain and I want concacenate piped data with some variable:
balh blah| ... $var1
What command I should use instead ... to concatenate piped output with $var1. I think I coud solve this using temp var - but could it be done in one line like sample above ?
thanks... (4 Replies)
I'm writing a Texas Hold'em script in bash v3.00.16(1) to learn more about awk/nawk scripts and regex expressions by trying to randomize a list of names using awk's rand function. The problem is that the elements in the var convert to a single element in the nawk script. I've tried several things,... (4 Replies)
Legends,
I have 2 files f1 and f2. when i use nawk to compare the difference(subtraction) from 4th column of the file, it truncates the output.
can you please help to resolve this.
subtraction is (4th col of f1 - 4th col of f2). but it gives only below lines out of 116. I want to print all... (7 Replies)
Hi all,
I have F5 load balancer on my system and checking service status by opening an ftp session in every 30 seconds. These ftp sessions are being logged in /var/adm/wtmpx and filling up the file. when i run the last command most of the output is this ftp session. I was wondering if there is a... (1 Reply)
Hi All,
I am working on nawk script, has the small function which prints the output on the screen.Am trying to print/append the same output in a file.
Basically nawk script should print the output on the console/screen and as well it should write/append the same result to a file.
script :... (3 Replies)
Discussion started by: Optimus81
3 Replies
LEARN ABOUT CENTOS
rake
RAKE(1) Ruby Programmers Reference Guide RAKE(1)NAME
rake -- Ruby Make
SYNOPSIS
rake [--f Rakefile] [--version] [-CGNPgnqstv] [-D [PATTERN]] [-E CODE] [-I LIBDIR] [-R RAKELIBDIR] [-T [PATTERN]] [-e CODE] [-p CODE]
[-r MODULE] [--rules] [variable=value] target ...
DESCRIPTION
Rake is a simple ruby(1) build program with capabilities similar to the regular make(1) command.
Rake has the following features:
o Rakefiles (Rake's version of Makefiles) are completely defined in standard Ruby syntax. No XML files to edit. No quirky Makefile syntax
to worry about (is that a tab or a space?).
o Users can specify tasks with prerequisites.
o Rake supports rule patterns to synthesize implicit tasks.
o Flexible FileLists that act like arrays but know about manipulating file names and paths.
o A library of prepackaged tasks to make building rakefiles easier.
OPTIONS --version Display the program version.
-C
--classic-namespace
Put Task and FileTask in the top level namespace
-D [PATTERN]
--describe [PATTERN]
Describe the tasks (matching optional PATTERN), then exit.
-E CODE
--execute-continue CODE
Execute some Ruby code, then continue with normal task processing.
-G
--no-system
--nosystem Use standard project Rakefile search paths, ignore system wide rakefiles.
-I LIBDIR
--libdir LIBDIR Include LIBDIR in the search path for required modules.
-N
--no-search
--nosearch Do not search parent directories for the Rakefile.
-P
--prereqs Display the tasks and dependencies, then exit.
-R RAKELIBDIR
--rakelib RAKELIBDIR
--rakelibdir RAKELIBDIR
Auto-import any .rake files in RAKELIBDIR. (default is rakelib )
-T [PATTERN]
--tasks [PATTERN] Display the tasks (matching optional PATTERN) with descriptions, then exit.
-e CODE
--execute CODE Execute some Ruby code and exit.
-f FILE
--rakefile FILE Use FILE as the rakefile.
-h
--help Prints a summary of options.
-g
--system Using system wide (global) rakefiles (usually ~/.rake/*.rake ).
-n
--dry-run Do a dry run without executing actions.
-p CODE
--execute-print CODE
Execute some Ruby code, print the result, then exit.
-q
--quiet Do not log messages to standard output.
-r MODULE
--require MODULE Require MODULE before executing rakefile.
-s
--silent Like --quiet, but also suppresses the 'in directory' announcement.
-t
--trace Turn on invoke/execute tracing, enable full backtrace.
-v
--verbose Log message to standard output (default).
--rules Trace the rules resolution.
SEE ALSO ruby(1)make(1)
http://rake.rubyforge.org/
REPORTING BUGS
Bugs, features requests and other issues can be logged at <http://onestepback.org/redmine/projects/show/rake>.
You will need an account to before you can post issues. Register at <http://onestepback.org/redmine/account/register>. Or you can send an
email to the author.
AUTHOR
Rake is written by Jim Weirich <jim@weirichhouse.org>
UNIX November 7, 2012 UNIX