Hi All,
I am facing a strange situation and want to find why it is occuring . When i convert the whole line into Hexadecimal character i can find the junk value after new line (\n) . If i look in binary mode it is not visible.
PLease let me know how possible the junk character is added... (1 Reply)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
i have an ip file like
121
1213412
34345353
long file
want to made each line as 20digit long append zero "0" in front
as 121
become
00000000000000000121 (1 Reply)
I know it sounds simple, but I want to e-mail the last 6 lines of a log file, which I have tailed into logresults.txt. I'm using
echo -e "Subject:server results\nFrom:server log <user@domain.com>\n"`cat logresults.txt` | sendmail -t user@domain.com
which works, but the body of the e-mail has... (4 Replies)
Hi,
How can I remove the line beak in the following case if the line begin with the special char ;?
TEXT
Text;text
;text
Text;text;text
I want to convert the text to:
Text;text;text
Text;text;text
I have already tried to use... (31 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
I have to pull multiple line records with ^ as the record separator(RS)... # should be my field separator (FS)...
Sample record is:
^-60#ORA-00060: deadlock detected while waiting for resource
ORA-00001: unique constraint (SARADM.TCKNUM_PK) violated#PROC:AVAILABLE_FOR_GETNXTTIC#02/27/2012... (7 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing To e-mail address
and column 3 contains cc e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hi,
How to append content into a file using tee command
echo " file1 is archived"| tee -a archive.txt
echo " file2 is archived"| tee -a archive.txt
echo " file3 is archived"| tee -a archive.txt
how to append content as new rows in the archive.txt
Thanks,
Srinadh. (4 Replies)
Hello experts!
I need your help please
I have a file.txt of which I want to extract 3rd and 4th columns with date with the form e.g.:
2016-11-25 03:14:50and pass them to "date" command, but also append the 9th column in a file as well.
So I want to execute
date -d '2016-11-25 03:14:50' ... (2 Replies)
Discussion started by: phaethon
2 Replies
LEARN ABOUT OPENDARWIN
lset
lset(n) Tcl Built-In Commands lset(n)
__________________________________________________________________________________________________________________________________________________NAME
lset - Change an element in a list
SYNOPSIS
lset varName ?index...? newValue
_________________________________________________________________DESCRIPTION
The lset command accepts a parameter, varName, which it interprets as the name of a variable containing a Tcl list. It also accepts zero
or more indices into the list. The indices may be presented either consecutively on the command line, or grouped in a Tcl list and pre-
sented as a single argument. Finally, it accepts a new value for an element of varName.
If no indices are presented, the command takes the form:
lset varName newValue
or
lset varName {} newValue
In this case, newValue replaces the old value of the variable varName.
When presented with a single index, the lset command treats the content of the varBane variable as a Tcl list. It addresses the index'th
element in it (0 refers to the first element of the list). When interpreting the list, lset observes the same rules concerning braces and
quotes and backslashes as the Tcl command interpreter; however, variable substitution and command substitution do not occur. The command
constructs a new list in which the designated element is replaced with newValue. This new list is stored in the variable varName, and is
also the return value from the lset command.
If index is negative or greater than or equal to the number of elements in $varName, then an error occurs.
If index has the value end, it refers to the last element in the list, and end-integer refers to the last element in the list minus the
specified integer offset.
If additional index arguments are supplied, then each argument is used in turn to address an element within a sublist designated by the
previous indexing operation, allowing the script to alter elements in sublists. The command,
lset a 1 2 newValue
or
lset a {1 2} newValue
replaces element 2 of sublist 1 with newValue.
The integer appearing in each index argument must be greater than or equal to zero. The integer appearing in each index argument must be
strictly less than the length of the corresponding list. In other words, the lset command cannot change the size of a list. If an index
is outside the permitted range, an error is reported.
EXAMPLES
In each of these examples, the initial value of x is:
set x [list [list a b c] [list d e f] [list g h i]]
=> {a b c} {d e f} {g h i}
The indicated return value also becomes the new value of x (except in the last case, which is an error which leaves the value of x
unchanged.)
lset x {j k l} => j k l
lset x {} {j k l} => j k l
lset x 0 j => j {d e f} {g h i}
lset x 2 j => {a b c} {d e f} j
lset x end j => {a b c} {d e f} j
lset x end-1 j => {a b c} j {g h i}
lset x 2 1 j => {a b c} {d e f} {g j i}
lset x {2 1} j => {a b c} {d e f} {g j i}
lset x {2 3} j => list index out of range
In the following examples, the initial value of x is:
set x [list [list [list a b] [list c d]]
[list [list e f] [list g h]]]
=> {{a b} {c d}} {{e f} {g h}}
The indicated return value also becomes the new value of x.
lset x 1 1 0 j => {{a b} {c d}} {{e f} {j h}}
lset x {1 1 0} j => {{a b} {c d}} {{e f} {j h}}
SEE ALSO
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lsort(n), lrange(n), lreplace(n)
KEYWORDS
element, index, list, replace, set
Tcl 8.4 lset(n)