Hi
I have a script that loops though lines of a file and reads each line in to a variable ($LINE).
I want to look at the line and split it into it's constituent parts.
e.g. a line might be "This is a string"
I want to then have variables set to each element thus:
A=This
B=is
C=a... (3 Replies)
could anyone help in running split cmd
split("String1,outputArray,"delimiter);
with sample script?.
for eg i have abc-def-ghi-sdf-
my ultimate aim of asking this is i have a string containing hypens,
i want to get the string before last n(2) Hypens (4 Replies)
Hi,
I am new to scripting and need help splitting a string using space as the delimiter.
How can I do that?
I want the result to be stored in an Array.
I tried using
set -A arr $(echo $FILE)
echo $arr
The result of the above was ''.
Thanks. (2 Replies)
I need to split the string msu1_2
It should be generic for any string of the form msu<digits>_<digits>
so that i get $X =1 and $Y = 2
Please help
Thanks (5 Replies)
Hi,
can we split a number like this.. if i have something like 85743975945738, can it be converted as 8574-3975-945738 in ksh shell using single command...
Thanks! (5 Replies)
Hi
I am facing a problem in spitting a string.
Here is the string
--------------------
subject1=10;subject2=30;subject3=40;subjectcode=10001;...
Now, I want only marks not the subject code. (there can be 'n' subjects)
ie.
10
30
40
My doubt
----------
How do I... (5 Replies)
I am trying to get some data from a file and print it on the same line.
I have a script that gets the body of emails and display it, but i want it to display each emails body in one line no matter how big it is. eg
insted of this
email1: bla bla bla
bla bla bla
bal
email2: bla bla bla... (7 Replies)
Hi,
We have a SunOS 5.10 Generic_142900-13 sun4v sparc SUNW,T5240.
I'm trying to find a way to split a string into 2 variables.
Ex:
parm1="192.168.1.101/parent/child"
What I need to do is split the string above into:
host="192.168.1.101"
location="parent/child"
I saw the... (3 Replies)
Hi All,
How to split the string KAR_Celltick_Ban_GSMGW3 and want to pickup the third filed. Sometime the string may be "KAR_Celltick_Ban" like this
Thanks in advance (1 Reply)
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
LEARN ABOUT OPENSOLARIS
echo
echo(1B) SunOS/BSD Compatibility Package Commands echo(1B)NAME
echo - echo arguments to standard output
SYNOPSIS
/usr/ucb/echo [-n] [argument]
DESCRIPTION
echo writes its arguments, separated by BLANKs and terminated by a NEWLINE, to the standard output.
echo is useful for producing diagnostics in command files and for sending known data into a pipe, and for displaying the contents of envi-
ronment variables.
For example, you can use echo to determine how many subdirectories below the root directory (/) is your current directory, as follows:
o echo your current-working-directory's full pathname
o pipe the output through tr to translate the path's embedded slash-characters into space-characters
o pipe that output through wc -w for a count of the names in your path.
example% /usr/bin/echo "echo $PWD | tr '/' ' ' | wc -w"
See tr(1) and wc(1) for their functionality.
The shells csh(1), ksh(1), and sh(1), each have an echo built-in command, which, by default, will have precedence, and will be invoked if
the user calls echo without a full pathname. /usr/ucb/echo and csh's echo() have an -n option, but do not understand back-slashed escape
characters. sh's echo(), ksh's echo(), and /usr/bin/echo, on the other hand, understand the black-slashed escape characters, and ksh's
echo() also understands a as the audible bell character; however, these commands do not have an -n option.
OPTIONS -n Do not add the NEWLINE to the output.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), echo(1), ksh(1), sh(1), tr(1), wc(1), attributes(5)NOTES
The -n option is a transition aid for BSD applications, and may not be supported in future releases.
SunOS 5.11 3 Aug 1994 echo(1B)