Sponsored Content
Top Forums UNIX for Advanced & Expert Users Without the aid of the escape mechanism, how to put a raw string into a variable? Post 303045764 by MadeInGermany on Sunday 12th of April 2020 12:11:42 PM
Old 04-12-2020
I forgot that read by default omits leading space (add IFS=), and mistreats a backslash (add -r).
Should be
Code:
IFS= read -r STRING << "EOT"
...

This User Gave Thanks to MadeInGermany For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Put raw data to column data

Dear all, I want below data to make it in column format.so i will see the data like this cdrID teleServiceCode chargedPartyNumber ... ... ... ... "egmailcom0w10ggzx00" 'sMS (5)' "716323770" "m17ifi5z30w0z6o7200" 'sMS (5)' ... (7 Replies)
Discussion started by: Nayanajith
7 Replies

2. UNIX for Advanced & Expert Users

Remove escape characters from string

Hello all, I have a string var which contains formatting characters at the end, it is a string with EScape sequences at the end of it. How can I remove them so that I only keep the 'real' text? I tried : var1=${var1%%\033[0m} does not seem to do the job .... Please help Thanks (2 Replies)
Discussion started by: gio001
2 Replies

3. Programming

how to use hex escape char with string in C?

I want it to ouput "abcd", but it dosen't. 1 #include<stdio.h> 2 int main() 3 { 4 printf("a\x62cd"); 5 } 6 gcc alarm.c -o alarm alarm.c: In function 'main': alarm.c:4:9: warning: hex escape sequence out of range It seems that the complier joint "cd" as part of... (8 Replies)
Discussion started by: vistastar
8 Replies

4. Shell Programming and Scripting

awk not escape my bash variable

I tried to parse data from switch configuration files vlan 1727 name SQ5506-15 by port tagged ethe 8/1 to 8/2 untagged ethe 1/13 ! vlan 2105 name SQ5620-7007(BR2) by port tagged ethe 8/1 to 8/2 untagged ethe 1/17 ! interface ethernet 1/13 port-name SQ5506-15.nic0 rate-limit... (2 Replies)
Discussion started by: winggundamth
2 Replies

5. Shell Programming and Scripting

How to store a escape character in a Variable.?

How to store escape character in the variable. Var=abc,def,ghi,jkl echo ${Var} | sed -e "s/,/|\\\\./g;s/^/\\\\./g" \.abc|\.def|\.ghi|\.hjk Var1=`echo ${Var} | sed -e "s/,/|\\\./g;s/^/\\\./g"` Actual: ------- echo $Var1 .abc|.def|.ghi|.jkl Expected: --------- echo $Var1... (4 Replies)
Discussion started by: deepakwins
4 Replies

6. UNIX for Beginners Questions & Answers

String has * as the field delimiter and I need echo/awk to escape it, how?

Hi, I am trying to read an Oracle listener log file line by line and need to separate the lines into several fields. The field delimiter for the line happens to be an asterisk. I have the script below to start with but when running it, the echo command is globbing it to include other... (13 Replies)
Discussion started by: newbie_01
13 Replies

7. Shell Programming and Scripting

How to escape colon sign from variable in shell?

Hello, Below script works fine when I manually enter required information for each file. When it comes to shell in auto mode, it gives various errors. I am under ubuntu 14.04 / trusty. manual_run.sh: #!/bin/bash /usr/bin/ffmpeg -start_at_zero -copyts -i nicki.mp4 -c:v mpeg2video \ -b:v 500k... (3 Replies)
Discussion started by: baris35
3 Replies

8. Shell Programming and Scripting

Escape characters in a variable

Debian 9 64x - LXDE How can i disable escape sequences in a variable? #!/bin/bash #mainscript . "./links.bash" echo "$red_start This text should be red $color_end"#!/bin/bash #links.bash #colors red_start="\eOutput that i get: \e Output expected: This text should be... (5 Replies)
Discussion started by: int3g3r
5 Replies
User::Identity::Collection::Emails(3pm) 		User Contributed Perl Documentation		   User::Identity::Collection::Emails(3pm)

NAME
User::Identity::Collection::Emails - a collection of email roles INHERITANCE
User::Identity::Collection::Emails is a User::Identity::Collection is a User::Identity::Item SYNOPSIS
DESCRIPTION
The "User::Identity::Collection::Emails" object maintains a set Mail::Identity objects, each describing a role which the user has in e-mail traffic. OVERLOADED
overload: @{} See "OVERLOADED" in User::Identity::Collection overload: stringification See "OVERLOADED" in User::Identity::Collection METHODS
Constructors User::Identity::Collection::Emails->new([NAME], OPTIONS) Option --Defined in --Default description User::Identity::Item undef item_type User::Identity::Collection Mail::Identity name User::Identity::Item 'emails' parent User::Identity::Item undef roles User::Identity::Collection undef . description => STRING . item_type => CLASS . name => STRING . parent => OBJECT . roles => ROLE|ARRAY Attributes $obj->description See "Attributes" in User::Identity::Item $obj->itemType See "Attributes" in User::Identity::Collection $obj->name([NEWNAME]) See "Attributes" in User::Identity::Item $obj->roles See "Attributes" in User::Identity::Collection Collections $obj->add(COLLECTION, ROLE) See "Collections" in User::Identity::Item $obj->addCollection(OBJECT | ([TYPE], OPTIONS)) See "Collections" in User::Identity::Item $obj->collection(NAME) See "Collections" in User::Identity::Item $obj->parent([PARENT]) See "Collections" in User::Identity::Item $obj->removeCollection(OBJECT|NAME) See "Collections" in User::Identity::Item $obj->type User::Identity::Collection::Emails->type See "Collections" in User::Identity::Item $obj->user See "Collections" in User::Identity::Item Maintaining roles $obj->addRole(ROLE| ( [NAME],OPTIONS ) | ARRAY-OF-OPTIONS) See "Maintaining roles" in User::Identity::Collection $obj->removeRole(ROLE|NAME) See "Maintaining roles" in User::Identity::Collection $obj->renameRole(ROLE|OLDNAME, NEWNAME) See "Maintaining roles" in User::Identity::Collection $obj->sorted See "Maintaining roles" in User::Identity::Collection Searching $obj->find(NAME|CODE|undef) See "Searching" in User::Identity::Collection DIAGNOSTICS
Error: $object is not a collection. The first argument is an object, but not of a class which extends User::Identity::Collection. Error: Cannot create a $type to add this to my collection. Some options are specified to create a $type object, which is native to this collection. However, for some reason this failed. Error: Cannot load collection module for $type ($class). Either the specified $type does not exist, or that module named $class returns compilation errors. If the type as specified in the warning is not the name of a package, you specified a nickname which was not defined. Maybe you forgot the 'require' the package which defines the nickname. Error: Cannot rename $name into $newname: already exists Error: Cannot rename $name into $newname: doesn't exist Error: Creation of a collection via $class failed. The $class did compile, but it was not possible to create an object of that class using the options you specified. Error: Don't know what type of collection you want to add. If you add a collection, it must either by a collection object or a list of options which can be used to create a collection object. In the latter case, the type of collection must be specified. Warning: No collection $name The collection with $name does not exist and can not be created. Error: Wrong type of role for $collection: requires a $expect but got a $type Each $collection groups sets of roles of one specific type ($expect). You cannot add objects of a different $type. SEE ALSO
This module is part of User-Identity distribution version 0.93, built on December 24, 2009. Website: http://perl.overmeer.net/userid/ LICENSE
Copyrights 2003,2004,2007-2009 by Mark Overmeer <perl@overmeer.net>. For other contributors see Changes. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.10.1 2009-12-24 User::Identity::Collection::Emails(3pm)
All times are GMT -4. The time now is 07:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy