Sponsored Content
Full Discussion: Joining string arguments
Top Forums Shell Programming and Scripting Joining string arguments Post 302367114 by steadyonabix on Sunday 1st of November 2009 10:03:39 AM
Old 11-01-2009
Code:
#!/bin/bash

shift 2
echo "$@"

or

Code:
#!/bin/bash
shift 2
for var in "$@"
do
  result=$result" "$var
done

echo $result

Woops sorry, as has been pointed out should be shift 2 not 3. I must make a note to read the posts before replying to them in future.... Smilie

Last edited by steadyonabix; 11-01-2009 at 11:36 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Joining string on multiple files

Hi guys, I am a forum (and a bit of a unix) newbie, and I currently have a tricky problem lying ahead of me. I have multiple files, and I am looking to join the files on the first column. Example: File 1 andy b 100 amy c 200 amy d 300 File 2 andy c 200 amy c 100 clyde o 50 ... (3 Replies)
Discussion started by: jdr0317
3 Replies

2. Shell Programming and Scripting

Need help joining two files with a common string

Hi all, I have one file that is in the form: S0243K05_T7_S0243K05_|_BASS2243.C7_K05 groupVI. 88.76 S0137F20_SP6_S0137F20_|_BASS2137d.SPB2.2_C10 groupXXI 88.06 S0056F03_T7_S0056F03_|_BASS256c.C7_C02 groupXIX 85.99 S0056F03_T7_S0056F03_|_BASS256c.C7_C02 groupXIX 83.23... (3 Replies)
Discussion started by: repiv
3 Replies

3. Shell Programming and Scripting

Help required on joining one line above & below to the pattern matched string line.

Hi Experts, Help needed on joining one line above & below to the pattern matched string line. The input file, required output is mentioned below Input file ABCD DEFG5 42.0.1-63.38.31 KKKK iokl IP Connection Available ABCD DEFG5 42.0.1-63.38.31 ... (7 Replies)
Discussion started by: krao
7 Replies

4. Shell Programming and Scripting

string manipulation in arguments

Hi all, I have a requirement where I am taking the first argument as argument name and storing the second argument in argument name as value. Thanks to ppl here, i learnt to do it.:p while ( $1 != "" ) set arg = $1 shift set val = "$1" echo "set... (2 Replies)
Discussion started by: animesharma
2 Replies

5. Shell Programming and Scripting

Reading a string and passing passing arguments to a while loop

I have an for loop that reads the following file cat param.cfg val1:env1:opt1 val2:env2:opt2 val3:env3:opt3 val4:env4:opt4 . . The for loop extracts the each line of the file so that at any one point, the value of i is val1:env1:opt1 etc... I would like to extract each... (19 Replies)
Discussion started by: goddevil
19 Replies

6. Shell Programming and Scripting

Removing command line arguments from string list

I am passing a list of strings $list and want to remove all entries with --shift=number, --sort=number/number/..., --group=number/number/... Also are removed whether upper or lower case letters are used For example the following will all be deleted from the list --shift=12 --shift=2324... (7 Replies)
Discussion started by: kristinu
7 Replies

7. Shell Programming and Scripting

How to avoid "Too many arguments" error, when passing a long String literal as input to a command?

Hi, I am using awk here. Inside an awk script, I have a variable which contains a very long XML data in string format (500kb). I want to pass this data (as argument) to curl command using system function. But getting Too many arguments error due to length of string data(payloadBlock). I... (4 Replies)
Discussion started by: cool.aquarian
4 Replies

8. 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

9. Shell Programming and Scripting

Processing arguments in a string

Hi The following code works when reading the arguments from the command line but fails when I try to read from a string. So this works while ; do case $1 in -dbversion) if '`" ]; then { echo "ERROR: missing value for '$1' (seen '$2')"; usage; exit 1; } else { shift;... (6 Replies)
Discussion started by: user052009
6 Replies

10. Shell Programming and Scripting

ksh parsing arguments in a string rather than from the cmdln

Hi. I have a piece of code that reads and parses command line options. I'd like to alter it slightly to read from a string (that's set elsewhere in the script) rather than directly from the command line (arg). Can somebody show me how to do this? Many thanks. My code is as follows: typeset... (6 Replies)
Discussion started by: user052009
6 Replies
fribidi_get_joining_types(3)					Programmer's Manual				      fribidi_get_joining_types(3)

NAME
fribidi_get_joining_types - get joining types for an string of characters SYNOPSIS
#include <fribidi.h> void fribidi_get_joining_types ( const FriBidiChar *str, const FriBidiStrIndex len, FriBidiJoiningType *jtypes ); PARAMETERS
const FriBidiChar *str Input string. const FriBidiStrIndex len Input string length. FriBidiJoiningType *jtypes Output joining types. Possible values for a FriBidiJoiningType are as follows: FRIBIDI_JOINING_TYPE_U NUn-joining, e.g. Full Stop. FRIBIDI_JOINING_TYPE_R Right-joining, e.g. Arabic Letter Dal. FRIBIDI_JOINING_TYPE_D Dual-joining, e.g. Arabic Letter Ain. FRIBIDI_JOINING_TYPE_C Join-Causing, e.g. Tatweel, ZWJ. FRIBIDI_JOINING_TYPE_T Transparent, e.g. Arabic Fatha. FRIBIDI_JOINING_TYPE_L Left-joining, i.e. Fictional. FRIBIDI_JOINING_TYPE_G IGnored, e.g. LRE, RLE, ZWNBSP. DESCRIPTION
This function finds the joining types of an string of characters. See fribidi_get_joining_type for more information about the joining types returned by this function. SEE ALSO
fribidi_charset_to_unicode(3), fribidi_unicode_to_charset(3), fribidi_parse_charset(3), fribidi_shape_arabic(3), fribidi_get_par_direc- tion(3), fribidi_get_par_embedding_levels(3), fribidi_reorder_line(3), fribidi_get_bidi_type(3), fribidi_get_bidi_types(3), fribidi_get_bidi_type_name(3), fribidi_debug_status(3), fribidi_mirroring_status(3), fribidi_set_mirroring(3), fribidi_reorder_nsm_sta- tus(3), fribidi_set_reorder_nsm(3), fribidi_log2vis_get_embedding_levels(3), fribidi_get_type(3), fribidi_get_type_internal(3), fribidi_remove_bidi_marks(3), fribidi_log2vis(3), fribidi_join_arabic(3), fribidi_get_joining_type(3), fribidi_get_joining_type_name(3), fribidi_get_mirror_char(3), fribidi_shape_mirroring(3), fribidi_shape(3) GNU FriBidi 0.19.2 30 January 2006 fribidi_get_joining_types(3)
All times are GMT -4. The time now is 02:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy