Sponsored Content
Top Forums Shell Programming and Scripting How to get array to not split at spaces? Post 302127866 by Raghuram.P on Friday 20th of July 2007 12:06:12 AM
Old 07-20-2007
Try to enclose the $line inside double quotes and use it like "$line"


Raghu
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

split to array in perl

Collegues I have flat file in the following format. 137 (NNP Kerala) (NNP India) 92 (NN Rent) (NN Range) 70 (NNP Thiruvananthapuram) (NNP Kerala) 43 (NNP Tourist) (NNP Home) 40 (NNP Reserve) (NNP Now) 25 (SYM @) (NN hotelskerala) 25 (NNP Thiruvananthapuram-695001) (NNP Kerala) 23 (NN... (3 Replies)
Discussion started by: jaganadh
3 Replies

2. UNIX for Dummies Questions & Answers

problem with the blank spaces in array

Hi all! i need your help. I'm getting started with this... in need to insert in an array string values. But the thing is that this strings have blank spaces... for example if a want to put "filed1 = " and "field2 = " .... in the array , when i want to print all the fields, it only shows... (4 Replies)
Discussion started by: kamicasse
4 Replies

3. Shell Programming and Scripting

array in ksh with elems containing spaces

Hi all, I've a .csv file containing data per line delimited with '|' (The fields may contains elements with spaces). e.g. (really a sample) ID|Name|fon 12345|Celal Dikici|+4921123456 12346|Celal Dikici Jun.|+4921123456 12347|Celal Dikici Sen.|+4921123456 12348|Celal|+4921123456... (3 Replies)
Discussion started by: Celald
3 Replies

4. Shell Programming and Scripting

split and making an array inside another array

I want to run an awk split on a value that has been pushed through an array and I was wondering what the syntax should be?? e.g. running time strings through an array and trying to examine just minutes: 12:25:30 10:15:13 08:55:23 awk ' NR==FNR{ ... (2 Replies)
Discussion started by: dcfargo
2 Replies

5. Shell Programming and Scripting

Split File of Number with spaces

How do i split a variable of numbers with spaces... for example echo "100 100 100 100" > temp.txt as the values can always change in temp.txt, i think it will be feasible to split the numbers in accordance to column. How is it possible to make it into $a $b $c $d? (3 Replies)
Discussion started by: dplate07
3 Replies

6. Shell Programming and Scripting

spaces in array field

I have a file, names(i) where each entry is 'first last' name. 'cat names' is fine. But in a shell script >for file in $(cat names) > do > echo $file > done the first and last name appear on 2 lines. I have tried escaping and quoting the space but to no avail. The names are to be... (4 Replies)
Discussion started by: chuckmg
4 Replies

7. Shell Programming and Scripting

split string into array in shell

Hi all, I want to split a string into array based on given delimiter, for example: String: "foo|bar|baz" with delimiter "|" into array: strArr to strArr with values foo, bar and baz. Thanks a lot. Roy987 (5 Replies)
Discussion started by: Roy987
5 Replies

8. Shell Programming and Scripting

Perl split and array

Hello, I have the following code: while ($line = <fd_in>) { 126 $line = " " . $line ; 127 print "our_line:$line\n"; 128 @list = split (/\s+/, $line) ; 129 print "after_split:@list\n"; 130 print "$list\t$list\t$list\t$list\t$list\t$list$list\t\n"; 131 $len =... (2 Replies)
Discussion started by: Zam_1234
2 Replies

9. UNIX for Beginners Questions & Answers

How to split a string into array?

value=malayalam # i need to store the value in an array by splitting the character #the output i need is m a l a y a l a m Please use CODE tags for output data as well as required by forum rules! (5 Replies)
Discussion started by: Meeran Rizvi
5 Replies

10. UNIX for Beginners Questions & Answers

How to split the string value to an array?

Test1.txt Tom is hot Test.sh filename="/directory/Test1.txt" set - A store while IFS= read value do awk '{split($value,store," ")}' done < "$filename" echo ${#sore} From the code in the executing file, I would like each... (8 Replies)
Discussion started by: TestKing
8 Replies
unshar(1)							   User Commands							 unshar(1)

NAME
unshar - unpack a shar archive SYNOPSIS
unshar [-flag [value]]... [--opt-name[[=| ]value]]... [ file ... ] DESCRIPTION
Unshar scans the input files (typically email messages) looking for the start of a shell archive. If no files are given, then standard input is processed instead. It then passes each archive discovered through an invocation of the shell program to unpack it. OPTIONS
-d dir, --directory=dir change directory to dir first. Before unpacking any files, change the current directory to dir. -c, --overwrite Overwrite any pre-existing files. This option is passed through as an option to the shar file. Many shell archive scripts accept a -c argument to indicate that existing files should be overwritten. -f, --force This is an alias for the --overwrite option. -E split-pat, --split-at=split-pat separate archives on split-pat lines. With this option, unshar isolates each different shell archive from the others which have been placed in the same file, unpacking each in turn, from the beginning of the file to the end. Its proper operation relies on the fact that many shar files are termi- nated by a readily identifiable string. For example, noticing that most `.signatures' have a double hyphen ("--") on a line right before them, one can then sometimes use --split-at=--. The signature will then be skipped, along with the headers of the following message. -e, --exit-0 split archives at "exit 0" lines. This option must not appear in combination with any of the following options: split-at. Most shell archives end with a line consisting of simply "exit 0". This option is equivalent to (and conflicts with) --split- at="exit 0". -h, --help Display usage information and exit. -!, --more-help Pass the extended usage information through a pager. -R [rcfile], --save-opts[=rcfile] Save the option state to rcfile. The default is the last configuration file listed in the OPTION PRESETS section, below. -r rcfile, --load-opts=rcfile, --no-load-opts Load options from rcfile. The no-load-opts form will disable the loading of earlier RC/INI files. --no-load-opts is handled early, out of order. -v [{v|c|n}], --version[={v|c|n}] Output version of program and exit. The default mode is `v', a simple version. The `c' mode will print copyright information and `n' will print the full copyright notice. OPTION PRESETS
Any option that is not marked as not presettable may be preset by loading values from configuration ("RC" or ".INI") file(s). The file "$HOME/.sharrc" will be used, if present. FILES
See OPTION PRESETS for configuration files. EXIT STATUS
One of the following exit values will be returned: 0 (EXIT_SUCCESS) Successful program execution. 1 (EXIT_FAILURE) The operation failed or the command syntax was not valid. 66 (EX_NOINPUT) A specified configuration file could not be loaded. 70 (EX_SOFTWARE) libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you. SEE ALSO
shar(1) AUTHORS
The shar and unshar programs is the collective work of many authors. Many people contributed by reporting problems, suggesting various improvements or submitting actual code. A list of these people is in the THANKS file in the sharutils distribution. COPYRIGHT
Copyright (C) 1994-2013 Free Software Foundation, Inc. all rights reserved. This program is released under the terms of the GNU General Public License, version 3 or later. BUGS
Please put sharutils in the subject line for emailed bug reports. It helps to spot the message. Please send bug reports to: bug-gnu-utils@gnu.org NOTES
This manual page was AutoGen-erated from the unshar option definitions. GNU sharutils (4.13.3) 06 Jan 2013 unshar(1)
All times are GMT -4. The time now is 10:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy