Sponsored Content
Top Forums Shell Programming and Scripting Store args passed in array but not the first 2 args Post 302843862 by ahamed101 on Thursday 15th of August 2013 11:31:00 AM
Old 08-15-2013
Code:
#!/bin/bash

shift 2
arr=( $* )
echo ${arr[*]}

Code:
user@Imperfecto_:~$ ./run 1 2 3 4 5 6
3 4 5 6

--ahamed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Args to Array

Hello all, I have a question. Please help me to populate an array with the arguments passing to a Shell scripts. For example when I call "abc.sh a1 a2 a3" args (a1, a2, ...) recieved in an Array inside the abc.sh arr = a1 arr = a2 and so on... Thanks in advance, (2 Replies)
Discussion started by: Shaz
2 Replies

2. UNIX for Dummies Questions & Answers

alias with args how to ...

Hello ( sorry newbie question ) I don't understand something im trying to make simple alias that takes 1 arg but it don't gives me the desire result here is what I have : stlist | awk '{print "ls -l "$2}' now I want to translate it to alias that takes instead of the $2 one arg so I did : ... (4 Replies)
Discussion started by: umen
4 Replies

3. Programming

Command line args

My program usage takes the form for example; $ theApp 2 "one or more words" i.e. 3 command line arguments; application name, an integer, some text My code includes the following 4 lines: int anInteger; char words; sscanf(argv, "%d", &anInteger); sscanf(argv, "%s", &message); Based... (2 Replies)
Discussion started by: enuenu
2 Replies

4. UNIX for Dummies Questions & Answers

command line args

I am trying to print command line arguments one per second. I have this while do echo "6" shift echo "5" shift echo "4" shift echo "3" shift echo "2" shift echo "1" shift done (2 Replies)
Discussion started by: skooly5
2 Replies

5. UNIX for Dummies Questions & Answers

command line args 2

I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence and it printed the value of $1 after every number. I don't want that I just want... (2 Replies)
Discussion started by: skooly5
2 Replies

6. UNIX for Dummies Questions & Answers

args of 50+ files

Hey.. I've gotten inspired by another thread and used this: #!/usr/bin/bash args 2,5 $(<file.list) It works but I'll like the results separated into different files or back into the 'used'/original files, whatever is easiest. e.g. use fileA | args 2,5 > fileB or fileA and then do this to... (9 Replies)
Discussion started by: lost
9 Replies

7. UNIX for Dummies Questions & Answers

Parameters/Args

Hello, i have a problem. I must write a script, which wants 2 arguments. for example: ./test.sh x.txt y.txtit must be write x.txt in y.txt and when i give 1 or no argument like /.test.sh x.txtmust this give a error message like: SYNTAX <inputfile> <outputfile> my solution is... (5 Replies)
Discussion started by: eightball
5 Replies

8. Shell Programming and Scripting

Store all the passed arguments in an array and display the array

Hi I want to write a script which store all the parameters passed to the script into an array. Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD. I want to know how can I... (3 Replies)
Discussion started by: dgmm
3 Replies

9. Shell Programming and Scripting

For Args and Nawk

I am trying to write a simple shell script that will take certain arguments (numerical values) and plug each one into a nawk command. I thought I would need to use for args x y z but i get syntax errors: for args 16 1 3 25 31 41 do nawk -F, '{if($10==$ &&... (8 Replies)
Discussion started by: he204035
8 Replies

10. Shell Programming and Scripting

Problem parsing args

Heya Tooltip: Parsing (getopts) for -u successfully sets mode=umnt, but case umnt is not executed, instead it either executes/show help or regular mount screen. I had copy pasted the structure of a getopts 'structure' from Man Page for getopts (posix Section 1) - The UNIX and Linux Forums... (1 Reply)
Discussion started by: sea
1 Replies
Test::RDF::Trine::Store(3pm)				User Contributed Perl Documentation			      Test::RDF::Trine::Store(3pm)

NAME
Test::RDF::Trine::Store - A collection of functions to test RDF::Trine::Stores VERSION
This document describes RDF::Trine version 1.000 SYNOPSIS
For example, to test a Memory store, do something like: use Test::RDF::Trine::Store qw(all_store_tests number_of_tests); use Test::More tests => 1 + Test::RDF::Trine::Store::number_of_tests; use RDF::Trine qw(iri variable store literal); use RDF::Trine::Store; my $data = Test::RDF::Trine::Store::create_data; my $store = RDF::Trine::Store::Memory->temporary_store(); isa_ok( $store, 'RDF::Trine::Store::Memory' ); Test::RDF::Trine::Store::all_store_tests($store, $data); DESCRIPTION
This module packages a few functions that you can call to test a RDF::Trine::Store, also if it is outside of the main RDF-Trine distribution. There are different functions that will test different parts of the functionality, but you should run them all at some point, thus for the most part, you would just like to run the "all_store_tests" function for quad stores and "all_triple_store_tests" for triple stores (i.e. stores that doesn't support named graphs). All the below functions are exported. FUNCTIONS
"number_of_tests" Returns the number of tests run with "all_store_tests". "number_of_triple_tests" Returns the number of tests run with "all_triple_store_tests". "create_data" Returns a hashref with generated test data nodes to be used by other tests. "all_store_tests ($store, $data, $todo, $args)" Will run all available tests for the given store, given the data from "create_data". You may also set a third argument to some true value to mark all tests as TODO in case the store is in development. Finally, an $args hashref can be passed. Valid keys are "update_sleep" (see the function with the same name below) and "suppress_dupe_tests" if the store should skip duplicate detection, "quads_unsupported" if the store is a triple store. "all_triple_store_tests ($store, $data, $todo, $args)" Will run tests for the given triple store, i.e. a store that only accepts triples, given the data from "create_data". You may also set a third argument to some true value to mark all tests as TODO in case the store is in development. For $args, see above. "add_quads($store, $args, @quads)" Helper function to add an array of quads to the given store. "add_triples($store, $args, @triples)" Helper function to add an array of triples to the given store. "contexts_tests( $store, $args )" Testing contexts (aka. "graphs") "add_statement_tests_simple( $store, $args, $data->{ex} )" Tests to check add_statement. "bulk_add_statement_tests_simple( $store, $args, $data->{ex} )" Tests to check add_statement. "literals_tests_simple( $store, $args, $data->{ex})" Tests to check literals support. "blank_node_tests_quads( $store, $args, $data->{ex} )" Tests to check blank node support for quads. "blank_node_tests_triples( $store, $args, $data->{ex} )" Tests to check blank node support for triples. "count_statements_tests_simple( $store, $args, $data->{ex} )" Tests to check that counts are correct. "count_statements_tests_quads( $store, $args, $data->{ex} )" Count statement tests for quads. "count_statements_tests_triples( $store, $args, $data->{ex}, $data->{nil} )" More tests for counts, with triples. "get_statements_tests_triples( $store, $args, $data->{ex} )" Tests for getting statements using triples. "get_statements_tests_quads( $store, $args, $data->{ex}, $data->{nil} )" Tests for getting statements using quads. "get_pattern_tests( $store, $args, $data->{ex} )" Tests for getting statements using with get_pattern. "remove_statement_tests( $store, $args, $data->{ex}, @{$data->{names}} );" Tests for removing statements. "update_sleep ( \%args )" If $args{ update_sleep } is defined, sleeps for that many seconds. This function is called after update operations to aid in testing stores that perform updates asynchronously. BUGS
Please report any bugs or feature requests to through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>. AUTHOR
Gregory Todd Williams <gwilliams@cpan.org> and Kjetil Kjernsmo <kjetilk@cpan.org> perl v5.14.2 2012-06-29 Test::RDF::Trine::Store(3pm)
All times are GMT -4. The time now is 05:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy