Sponsored Content
Operating Systems Solaris spaces trimming while assigning to a variable Post 302075652 by Lokesha on Tuesday 6th of June 2006 05:55:02 AM
Old 06-06-2006
Question spaces trimming while assigning to a variable

Hi my lovely friends,

Im writing one pgm in which i trying to assign some values like
$var='Jun 6'
but if i do echo of this $var will trim the spaces expect one space.
$echo $var
$Jun 6

But if var='Jun 28', then this will works fine
$echo $var
$Jun 28

this is required to exctract date wise files like
$ls -lrt
XXXXXXXXXXXXX XXXXXXXXX XXXXXXX 00:10 Jun 6 test.txt
XXXXXXXXXXXXX XXXXXXXXX XXXXXXX 00:10 Jun 28 test.txt

$var=`ls -lrt | grep -i 'Jun 6'`
$echo $var
$Jun 6

this is very much essential for my program.
Hope your help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Strip leading and trailing spaces only in a shell variable with embedded spaces

I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help. echo $SH_VAR | command_line Syntax. The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies

2. Shell Programming and Scripting

trimming white spaces

I have a variable that calls in a string from txt file. Problem is the string comes with an abundance of white spaces trailing it. Is there any easy way to trim the tailing white spaces off at the end? Thanks in advance. (9 Replies)
Discussion started by: briskbaby
9 Replies

3. UNIX for Advanced & Expert Users

Trimming the spaces

Hi, How can I remove the unwanted spaces in the line. 123456 789 ABC DEF. - I wanna remove the sapces in this line, I need the output 123456789ABCDEF. Pls help me...... (3 Replies)
Discussion started by: sharif
3 Replies

4. Shell Programming and Scripting

trimming trailing slashes in variable

I'm using this thread as an example, but can't seem to apply it to my situation. I'm trying to strip the trailing slash (/) from an input argument. Here's a snippet of my command line input and the troublesome code: $ script_name -s "../pathname/dir/" snip 8< ... while getopts :s:... (5 Replies)
Discussion started by: ricksj
5 Replies

5. Shell Programming and Scripting

trimming out spaces in solaris

friends, I have a script in solaris 10 SPARC system which is like this date '+Time: %m/%d/%y %H:%M:%S' echo " GDBRR GDLRR GDBWR GDLWR GDRRR GDRWR " sar -b 10 10 |/usr/xpg4/bin/awk '!/Average/ && !/SunOS/ && !/bread/ {$1="";T=$2;T1=$3;T2=$5;T3=$6;T4=$8;T5=$9}{print(T"\t",... (1 Reply)
Discussion started by: achak01
1 Replies

6. Shell Programming and Scripting

Removing a character from a variable and assigning it to another variable?

Hi folks. I have this variable called FirstIN that contains something like this: 001,002,003,004... I am trying to assign the content of this variable into ModifiedIN but with the following format : 001 002 003 004...(changing the commas for spaces) I thought about using sed but i am not... (17 Replies)
Discussion started by: Stephan
17 Replies

7. Shell Programming and Scripting

How can I stop the unix script from trimming extra spaces?

I have a file which contains certain records about users. the row length is always fixed to 205 characters. Now I want to read each record line from the file, substring some portion out of it and put into another file. But I have observed that my script is trimming the extra spaces I have used for... (4 Replies)
Discussion started by: Pramit
4 Replies

8. Shell Programming and Scripting

Trimming spaces from a variable

Hi guys, when I take substring of a particular data using this command var=substr($0,11,10) it comes with spaces, when I am trying to trim the spaces it is not allowing me to do that. Can you please help me out on that. As I have to reverse the output of the variable also. ---------- Post... (0 Replies)
Discussion started by: manish8484
0 Replies

9. Shell Programming and Scripting

Trimming Spaces in Unix

Hi All, I am using following script to name the file base of some values #!/bin/sh sourcefile=$1 awk ' BEGIN{ n = 1; name = "FILEFILE12" n ".txt"; } { if (substr($0,1,10) == "FILEFILE12") { close (name) n++ a = substr($0,11,10); b = substr($0,21,5); name = b "_Src_" a ".txt" }... (6 Replies)
Discussion started by: manish8484
6 Replies

10. Shell Programming and Scripting

problem in assigning value to variable have value fo other variable

my script is some thing like this i11="{1,2,3,4,5,6,7,8,9,10,11,}" echo "enter value" read value ..............suppose i11 x="$value" echo "$($value)" .............the echo should be {1,2,3,4,5,6,7,8,9,10,11,} but its showing "i11" only. plz help me out to get desired... (10 Replies)
Discussion started by: sagar_1986
10 Replies
DateTime::Locale::dz(3) 				User Contributed Perl Documentation				   DateTime::Locale::dz(3)

NAME
DateTime::Locale::dz SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'dz' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Dzongkha. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) XXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXXXXXX XXXXXXXXX Abbreviated (format) XXXX XXXX XXXX XXXX XXXXX XXX XXX Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) XXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXXXXXX XXXXXXXXX Abbreviated (stand-alone) XXXX XXXX XXXX XXXX XXXXX XXX XXX Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) XXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX Abbreviated (format) XXX X XXX X XXX X XXX X XXX X XXX X XXX X XXX X XXX X XXX XX XXX XX XXX XX Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) XXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX Abbreviated (stand-alone) XXX X XXX X XXX X XXX X XXX X XXX X XXX X XXX X XXX X XXX XX XXX XX XXX XX Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) XXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXX Abbreviated (format) XXXXXXXXX XXXXXXXXX XXXXXXXXX XXXXXXXXX Narrow (format) 1 2 3 4 Wide (stand-alone) XXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXX Abbreviated (stand-alone) XXXXXXXXX XXXXXXXXX XXXXXXXXX XXXXXXXXX Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated BCE CE Narrow BCE CE Date Formats Full 2008-02-05T18:30:30 = XXXXXXXX2008 XXX XXXXXXXXXXXXXXXX XXXX 05 1995-12-22T09:05:02 = XXXXXXXX1995 XXX XXXXXXXXXXXXXXXXXXXX XXXX 22 -0010-09-15T04:44:23 = XXXXXXXX-10 XXX XXXXXXXXXXXXXXX XXXX 15 Long 2008-02-05T18:30:30 = XXXXXXXX2008 XXX XXXXXXXXXXXXXXXX XXXX 05 1995-12-22T09:05:02 = XXXXXXXX1995 XXX XXXXXXXXXXXXXXXXXXXX XXXX 22 -0010-09-15T04:44:23 = XXXXXXXX-10 XXX XXXXXXXXXXXXXXX XXXX 15 Medium 2008-02-05T18:30:30 = XXXXXXXX2008 XXX XXX X XXXX 05 1995-12-22T09:05:02 = XXXXXXXX1995 XXX XXX XX XXXX 22 -0010-09-15T04:44:23 = XXXXXXXX-10 XXX XXX X XXXX 15 Short 2008-02-05T18:30:30 = 2008-02-05 1995-12-22T09:05:02 = 1995-12-22 -0010-09-15T04:44:23 = -010-09-15 Default 2008-02-05T18:30:30 = XXXXXXXX2008 XXX XXX X XXXX 05 1995-12-22T09:05:02 = XXXXXXXX1995 XXX XXX XX XXXX 22 -0010-09-15T04:44:23 = XXXXXXXX-10 XXX XXX X XXXX 15 Time Formats Full 2008-02-05T18:30:30 = XXXXXXX 6 XXXXXX 30 XXXXXXX 30 XXXXXX UTC 1995-12-22T09:05:02 = XXXXXXX 9 XXXXXX 05 XXXXXXX 02 XXXXX UTC -0010-09-15T04:44:23 = XXXXXXX 4 XXXXXX 44 XXXXXXX 23 XXXXX UTC Long 2008-02-05T18:30:30 = XXXXXXX 6 XXXXXX 30 XXXXXXX 30 XXXXXX UTC 1995-12-22T09:05:02 = XXXXXXX 9 XXXXXX 05 XXXXXXX 02 XXXXX UTC -0010-09-15T04:44:23 = XXXXXXX 4 XXXXXX 44 XXXXXXX 23 XXXXX UTC Medium 2008-02-05T18:30:30 = XXXXXXX6:30:30 XXXXXX 1995-12-22T09:05:02 = XXXXXXX9:05:02 XXXXX -0010-09-15T04:44:23 = XXXXXXX4:44:23 XXXXX Short 2008-02-05T18:30:30 = XXXXXXX 6 XXXXXX 30 XXXXXX 1995-12-22T09:05:02 = XXXXXXX 9 XXXXXX 05 XXXXX -0010-09-15T04:44:23 = XXXXXXX 4 XXXXXX 44 XXXXX Default 2008-02-05T18:30:30 = XXXXXXX 6 XXXXXX 30 XXXXXXX 30 XXXXXX UTC 1995-12-22T09:05:02 = XXXXXXX 9 XXXXXX 05 XXXXXXX 02 XXXXX UTC -0010-09-15T04:44:23 = XXXXXXX 4 XXXXXX 44 XXXXXXX 23 XXXXX UTC Datetime Formats Full 2008-02-05T18:30:30 = XXXXXXXX2008 XXX XXXXXXXXXXXXXXXX XXXX 05 XXXXXXX 6 XXXXXX 30 XXXXXXX 30 XXXXXX UTC 1995-12-22T09:05:02 = XXXXXXXX1995 XXX XXXXXXXXXXXXXXXXXXXX XXXX 22 XXXXXXX 9 XXXXXX 05 XXXXXXX 02 XXXXX UTC -0010-09-15T04:44:23 = XXXXXXXX-10 XXX XXXXXXXXXXXXXXX XXXX 15 XXXXXXX 4 XXXXXX 44 XXXXXXX 23 XXXXX UTC Long 2008-02-05T18:30:30 = XXXXXXXX2008 XXX XXXXXXXXXXXXXXXX XXXX 05 XXXXXXX 6 XXXXXX 30 XXXXXXX 30 XXXXXX UTC 1995-12-22T09:05:02 = XXXXXXXX1995 XXX XXXXXXXXXXXXXXXXXXXX XXXX 22 XXXXXXX 9 XXXXXX 05 XXXXXXX 02 XXXXX UTC -0010-09-15T04:44:23 = XXXXXXXX-10 XXX XXXXXXXXXXXXXXX XXXX 15 XXXXXXX 4 XXXXXX 44 XXXXXXX 23 XXXXX UTC Medium 2008-02-05T18:30:30 = XXXXXXXX2008 XXX XXX X XXXX 05 XXXXXXX6:30:30 XXXXXX 1995-12-22T09:05:02 = XXXXXXXX1995 XXX XXX XX XXXX 22 XXXXXXX9:05:02 XXXXX -0010-09-15T04:44:23 = XXXXXXXX-10 XXX XXX X XXXX 15 XXXXXXX4:44:23 XXXXX Short 2008-02-05T18:30:30 = 2008-02-05 XXXXXXX 6 XXXXXX 30 XXXXXX 1995-12-22T09:05:02 = 1995-12-22 XXXXXXX 9 XXXXXX 05 XXXXX -0010-09-15T04:44:23 = -010-09-15 XXXXXXX 4 XXXXXX 44 XXXXX Default 2008-02-05T18:30:30 = XXXXXXXX2008 XXX XXX X XXXX 05 XXXXXXX 6 XXXXXX 30 XXXXXXX 30 XXXXXX UTC 1995-12-22T09:05:02 = XXXXXXXX1995 XXX XXX XX XXXX 22 XXXXXXX 9 XXXXXX 05 XXXXXXX 02 XXXXX UTC -0010-09-15T04:44:23 = XXXXXXXX-10 XXX XXX X XXXX 15 XXXXXXX 4 XXXXXX 44 XXXXXXX 23 XXXXX UTC Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 XXXX 1995-12-22T09:05:02 = 22 XXXXX -0010-09-15T04:44:23 = 15 XXX Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 XXXXXX 1995-12-22T09:05:02 = 9:05 XXXXX -0010-09-15T04:44:23 = 4:44 XXXXX Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 XXXXXX 1995-12-22T09:05:02 = 9:05:02 XXXXX -0010-09-15T04:44:23 = 4:44:23 XXXXX M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = XXXX, 2-5 1995-12-22T09:05:02 = XXXXX, 12-22 -0010-09-15T04:44:23 = XXX, 9-15 MMM (LLL) 2008-02-05T18:30:30 = XXX X 1995-12-22T09:05:02 = XXX XX -0010-09-15T04:44:23 = XXX X MMMd (MMM d) 2008-02-05T18:30:30 = XXX X 5 1995-12-22T09:05:02 = XXX XX 22 -0010-09-15T04:44:23 = XXX X 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = XXXX XXX X 5 1995-12-22T09:05:02 = XXXXX XXX XX 22 -0010-09-15T04:44:23 = XXX XXX X 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = XXXXXXXXXXXXXXXX 5 1995-12-22T09:05:02 = XXXXXXXXXXXXXXXXXXXX 22 -0010-09-15T04:44:23 = XXXXXXXXXXXXXXX 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = XXXX XXXXXXXXXXXXXXXX 5 1995-12-22T09:05:02 = XXXXX XXXXXXXXXXXXXXXXXXXX 22 -0010-09-15T04:44:23 = XXX XXXXXXXXXXXXXXX 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = XXXX, 2008-2-5 1995-12-22T09:05:02 = XXXXX, 1995-12-22 -0010-09-15T04:44:23 = XXX, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 XXX X 1995-12-22T09:05:02 = 1995 XXX XX -0010-09-15T04:44:23 = -10 XXX X yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = XXXX, 2008 XXX X 5 1995-12-22T09:05:02 = XXXXX, 1995 XXX XX 22 -0010-09-15T04:44:23 = XXX, -10 XXX X 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 XXXXXXXXXXXXXXXX 1995-12-22T09:05:02 = 1995 XXXXXXXXXXXXXXXXXXXX -0010-09-15T04:44:23 = -10 XXXXXXXXXXXXXXX yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 XXXXXXXXX 1995-12-22T09:05:02 = 1995 XXXXXXXXX -0010-09-15T04:44:23 = -10 XXXXXXXXX yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? No Local first day of the week XXXXXXXXXXXX SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.16.3 2014-06-10 DateTime::Locale::dz(3)
All times are GMT -4. The time now is 04:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy