Sponsored Content
Full Discussion: Return Awk Variable to Shell
Top Forums Shell Programming and Scripting Return Awk Variable to Shell Post 302342055 by ryandegreat25 on Friday 7th of August 2009 09:58:11 AM
Old 08-07-2009
yes.. that's the current code i'm using.. can i not do it in one line? or at least the shortest way
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

return variable from PL/SQL procedure to shell

Hi i'm calling a pl/sql procedure which is returning one variable. i'm trying to assing this value to variable in shell script the code i wrote is ** in shell script** var= 'sqlplus user/pass @ret.sql' echo $var ** and variable dum_var number exec rt_test(:DUM_VAR); exit; in... (4 Replies)
Discussion started by: ap_gore79
4 Replies

2. Shell Programming and Scripting

How to use substr to return data into a shell script variable?

I'm writing a shell script in which I need to be able to pull a portion of the file name out. I'm testing with the following code: x="O1164885.DAT" y=`ls -ltr *${x}|awk '{print substr($0,3)}'` echo ${x}|awk '{print substr($0,3)}' echo "y="$y I can echo it to the screen just fine but I... (3 Replies)
Discussion started by: ttunell
3 Replies

3. Shell Programming and Scripting

Insert a line including Variable & Carriage Return / sed command as Variable

I want to instert Category:XXXXX into the 2. line something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong: sed "2i\\${n}Category:$cat\n" Sample: Titel Blahh Blahh abllk sdhsd sjdhf Blahh Blah Blahh Blahh Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies

4. Shell Programming and Scripting

Awk return variable

Hi I have 2 working script, now i'd like to get the return value from the first and give it to the 2 script (both script work correctly if I run it separately). so i think the problem is only the first line in the way i pass the variable. in the final the "print lst", is just to check the... (2 Replies)
Discussion started by: Dedalus
2 Replies

5. Shell Programming and Scripting

How to return a value of a variable from shell script to perl script

HI , Is there any way to return a value of variable from shell to perl script. Code: === Perl file my $diff1=system("sh diff.sh"); my $diff2=system("sh diff1.sh"); I need exit status of below commands i.e 0 and 1 respectively. Since in both the cases diff is working so system... (3 Replies)
Discussion started by: srkelect
3 Replies

6. Shell Programming and Scripting

assign awk's variable to shell script's variable?

Dear All, we have a command output which looks like : Total 200 queues in 30000 Kbytes and we're going to get "200" and "30000" for further process. currently, i'm using : numA=echo $OUTPUT | awk '{print $2}' numB=echo $OUTPUT | awk '{print $5}' my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies

7. Shell Programming and Scripting

Assigning return value of an embedded SQL in a shell script variable

I've a script of the following form calling a simple sql that counts the no of rows as based on some conditions. I want the count returned by the sql to get assigned to the variable sql_ret_val1. However I'm finding that this var is always getting assigned a value of 0. I have verified by executing... (1 Reply)
Discussion started by: MxC
1 Replies

8. Shell Programming and Scripting

Return value inside isql to a shell variable in ksh

Hello, I have a shell script where I am doing an isql to select some records. the result i get from the select statement is directed to an output file. I want to assign the result to a Shell variable so that I can use the retrieved in another routine. e.g. "isql -U${USER} -P${PASSWD} -S${SERVER}... (1 Reply)
Discussion started by: RookieDev
1 Replies

9. Shell Programming and Scripting

Shell Variables passed to awk to return certain rows

Hi Forum. I have the following test.txt file and need to extract certain rows based on "starting position", "length of string" and "string to search for": 1a2b3d 2a3c4d ..... My script accepts 3 parameters: (starting col pos, length to search for, string to search for) and would like to... (4 Replies)
Discussion started by: pchang
4 Replies

10. UNIX for Beginners Questions & Answers

How can I assign awk's variable to shell script's variable?

I have the following script, and I want to assign the output ($10 and $5) from awk to N and L: grdinfo data.grd | awk '{print $10,$5}'| read N L output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies
mcx erdos(1)							  USER COMMANDS 						      mcx erdos(1)

  NAME
      mcx erdos - compute shortest paths in a graph

  SYNOPSIS
      mcx erdos [options]

      mcxerdos	is  not  in  actual  fact  a program. This manual page documents the behaviour and options of the mcx program when invoked in mode
      erdos. The options -h, --apropos, --version, -set, --nop, -progress <num> are accessible in all mcx modes. They are  described  in  the  mcx
      manual page.

      mcx  erdos  [-query  <fname>  (query input stream)] [-abc <fname> (specify label input)] [-imx <fname> (specify matrix input)] [-tab <fname>
      (use tab file)] [-o <fname> (output file name)] [--is-directed (input graph  is  directed)]  [--is-undirected  (input  graph  is	directed)]
      [-write-path  <fname>  (path  matrix file)] [-write-step <fname> (step matrix file)] [-h (print synopsis, exit)] [--apropos (print synopsis,
      exit)] [--version (print version, exit)]

  DESCRIPTION
      mcx erdos computes shortest paths in graphs.  It can read a graph either in label format with -abc or in native format with -imx.  It  reads
      pairs of node indices from an input stream, and for each pair outputs a data structure describing the full set of shortest paths between the
      two nodes.  Edge weights are not taken into account, so an edge always represents a unit step size between two  nodes  irrespective  of  its
      weight. A mode to compute shortest paths while taking into account edge weights will be implemented later as mcx dijkstra.

      Note  that  the  full set of shortest paths between two nodes in a graph can be described as a directed acyclic graph (DAG), and this is how
      mcx erdos operates. It is easy to construct graphs and node pairs for which the number of shortest paths between the two nodes becomes expo-
      nential in the size of the graph, whereas the lattice description is always garantueed to map to a subset of the graph edge set.

      By  default  it is assumed that the input graph should be treated as undirected. To this end a transformation step is applied to ensure that
      the graph in memory is undirected. It is possible to compute shortest paths in directed graphs by using --is-directed, and it is possible to
      omit  the  transformation  step  by using --is-undirected.  If the latter is specified while the input graph is in native format and in fact
      directed, results will be erroneous. This could in theory be mitigated by checking that the input graph is undirected. However,  the  reason
      to  use --is-undirected is simply to increase speed of operation, whereas such a check would be equally expensive as the transformation step
      that is omitted with --is-undirected.

      The input graph/matrix, if specified with the -imx option, has to be in mcl matrix/graph format. You can use label input	instead  by  using
      the  -abc option.  Refer to mcxio(5) for a description of these two input formats.  By default mcx erdos reads from STDIN and expects matrix
      format.  To specify label input from STDIN use -abc -.

  OPTIONS
      -query <fname> (query input)
	The name for the file from which queries are read.  A query consists of two white-space separated node indices or  two	white-space  sepa-
	rated labels. Labels can only be used if either -abc or -tab is specified.

      -abc <fname> (label input)
	The file name for input that is in label format.

      -imx <fname> (input matrix)
	The file name for input that is in mcl native matrix format.

      -o <fname> (output file name)
	The name of the file to write output to.

      -tab <fname> (use tab file)
	This  option causes the output to be printed with the labels found in the tab file.  With -abc this option will, additionally, construct a
	graph only on the labels found in the tab file.  If this option is used in conjunction with -imx the tab domain and the matrix domain  are
	required to be identical.

      --is-directed (compute directed shortest paths)
	The input graph is not transformed and assumed to be directed.	Shortest paths are computed taking this into account.

      --is-undirected (skip symmetrification step)
	The  input  graph  is not transformed and assumed to be undirected.  Shortest paths are computed on the assumption that the input is undi-
	rected. Use this option only if you are sure the input is undirected and need to have faster execution.

      -write-path <fname> (path matrix file)
      -write-step <fname> (step matrix file)
	The path matrix enumerates the nodes that take part in all shortest paths. The first list contains those nodes that lie at distance  1	of
	the  source  node, the second list contains nodes lying at distance 2, and so on.  The step matrix contains all the edges that make up the
	lattice of shortest paths between the two query nodes.

  SEE ALSO
      mcxio(5), and mclfamily(7) for an overview of all the documentation and the utilities in the mcl family.

  mcx erdos 12-068						      8 Mar 2012							mcx erdos(1)
All times are GMT -4. The time now is 09:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy