Sponsored Content
Top Forums Shell Programming and Scripting Print arguments with the help of variable Post 302498224 by hakermania on Sunday 20th of February 2011 03:43:51 PM
Old 02-20-2011
Hey thanks, this worked....!
Can you explain me please what the number 5 represents here?
I mean if I need to take the arguments from $7 and next, should I do
${@:7:5}
?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print arguments along with spaces using awk

Hi All, file_1.txt contains aaa bbbb hhhh vvvvv mmmmm iiiii What i want is to search for the first coloumn of each line using awk.i.e as below: awk '/aaa/ {printf(<>)}' file_1.txt The print part (<>) should contain all the values(or coloumns ) in the particular line(here it... (8 Replies)
Discussion started by: jisha
8 Replies

2. Shell Programming and Scripting

How to call arguments with variable in a script??

Hello, I was wondering if it were possible to call arguments passed to a script using a variable. For example: sh script.sh yes no good bad x=$# while do echo (last argument, then second last etc until first argument) let x=($x-1) done should print out bad good no (4 Replies)
Discussion started by: VanK
4 Replies

3. Shell Programming and Scripting

How to make bash wrapper for java/groovy program with variable length arguments lists?

The following bash script does not work because the java/groovy code always thinks there are four arguments even if there are only 1 or 2. As you can see from my hideous backslashes, I am using cygwin bash on windows. export... (1 Reply)
Discussion started by: siegfried
1 Replies

4. UNIX for Dummies Questions & Answers

How to print arguments in reverse order?

Hey all, How do I make a script print its arguments in reverse order? Thanks (5 Replies)
Discussion started by: unclepickle1
5 Replies

5. Shell Programming and Scripting

Unable to print dynamic arguments in for loop

Hi All, I want to pass few dynamic arguments to shell script. The number of arguments differ each time I call the script. I want to print the arguments using the for loop as below. But not working out. for (( i=1; i<=$#; i++ )) do echo $"($i)" done /bin/sh test.sh arg1 arg2 arg3 ... (1 Reply)
Discussion started by: laalesh
1 Replies

6. Shell Programming and Scripting

awk print variable then fields in variable

i have this variable: varT="1--2--3--5" i want to use awk to print field 3 from this variable. i dont want to do the "echo $varT". but here's my awk code: awk -v valA="$varT" "BEGIN {print valA}" this prints the entire line. i feel like i'm so close to getting what i want. i... (4 Replies)
Discussion started by: SkySmart
4 Replies

7. Shell Programming and Scripting

Print arguments using array elements not working?

Hey guys, I'm new to shell scripting and I'm trying to write a script that takes user input and copies the specified columns from a data file to a new one. In order to account for the possibility of a variable number of columns to copy I wrote a loop that encodes the user's choices in an array... (16 Replies)
Discussion started by: shaner
16 Replies

8. Shell Programming and Scripting

Using echo to print arguments inside a function

I am using echo in bash. Have created a function prargv which takes a number of arguments. Example: prargv "-e" "--examples" Inside prargv, I want to print all the arguments using echo echo "$@" This returns --examples rather than -e --examples" This problem can be fixed... (3 Replies)
Discussion started by: kristinu
3 Replies

9. Shell Programming and Scripting

To print value for a $variable inside a $variable or file

Hi guys, I have a file "abc.dat" in below format: FILE_PATH||||$F_PATH TABLE_LIST||||a|b|c SYST_NM||||${SRC_SYST} Now I am trying to read the above file and want to print the value for above dollar variables F_PATH and SRC_SYST. The problem is it's reading the dollar variables as... (5 Replies)
Discussion started by: abcabc1103
5 Replies

10. Shell Programming and Scripting

Arguments in variable vs direct string

Hello Community! Let's say that we have some script which counts its arguments number: arguments_count.sh: #!/bin/sh echo "Number of arguments="$#and some test script: test.sh: #!/bin/sh my_args="1 2 3 '4 5' 6" echo "Count of arguments when using my_args:" ./arguments_count.sh $my_args... (12 Replies)
Discussion started by: break_da_funk
12 Replies
LaTeXML::Number(3pm)					User Contributed Perl Documentation				      LaTeXML::Number(3pm)

NAME
"LaTeXML::Number" - representation of numbers, dimensions, skips and glue. DESCRIPTION
This module defines various dimension and number-like data objects "LaTeXML::Number" represents numbers, "LaTeXML::Float" represents floating-point numbers, "LaTeXML::Dimension" represents dimensions, "LaTeXML::MuDimension" represents math dimensions, "LaTeXML::Glue" represents glue (skips), "LaTeXML::MuGlue" represents math glue, "LaTeXML::Pair" represents pairs of numbers "LaTeXML::Pairlist" represents list of pairs. Common methods The following methods apply to all objects. "@tokens = $object->unlist;" Return a list of the tokens making up this $object. "$string = $object->toString;" Return a string representing $object. "$string = $object->ptValue;" Return a value representing $object without the measurement unit (pt) with limited decimal places. Numerics methods These methods apply to the various numeric objects "$n = $object->valueOf;" Return the value in scaled points (ignoring shrink and stretch, if any). "$n = $object->smaller($other);" Return $object or $other, whichever is smaller "$n = $object->larger($other);" Return $object or $other, whichever is larger "$n = $object->absolute;" Return an object representing the absolute value of the $object. "$n = $object->sign;" Return an integer: -1 for negatives, 0 for 0 and 1 for positives "$n = $object->negate;" Return an object representing the negative of the $object. "$n = $object->add($other);" Return an object representing the sum of $object and $other "$n = $object->subtract($other);" Return an object representing the difference between $object and $other "$n = $object->multiply($n);" Return an object representing the product of $object and $n (a regular number). AUTHOR
Bruce Miller <bruce.miller@nist.gov> COPYRIGHT
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US. perl v5.10.1 2009-06-11 LaTeXML::Number(3pm)
All times are GMT -4. The time now is 05:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy