Hi all, I'd like to capture the output from the 'top' command to monitor my CPU and Mem utilisation.Currently my command isecho date
`top -b -n1 | grep -e Cpu -e Mem` I get the output in 3 separate lines.Tue Feb 24 15:00:03
Cpu(s): 3.4% us, 8.5% sy .. ..
Mem: 1011480k total, 226928k used, ....... (4 Replies)
Hi all,
I have input text file of this format
objectclass:endeavor
pid:12345
postalAddress:379 PROSPECT ST
street:STE B
l:TORRINGTON
st:CT
postalCode:067905238
telephoneNumber:9999999999... (2 Replies)
i am running df -k command on aix machine.
i got the output like this. i need to store into file and send that file into microsoft excel.i need to allign properly.
Filesystem 512 blocks Free % Used Iused %Iused Mounted on
/dev/hd4 262144 126488 52% ... (9 Replies)
Hi,
I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format.
Example:
File.txt
AP|{SSHA}VEEg42CNCghUnGhCVg==
APVG3|{SSHA}XK|"password"
AP3|{SSHA}XK|"This is test"
....
etc
---------
test.sh has... (1 Reply)
Hi All ,
Below is the perl code. from below code want to confirm one thing that
wahtever the sequence of data we are passing through json format which contains 3 tuples of different sequences
Eg:
ParentID,SystemID,SendingTime,Time,ClientLocation,ClientID,
... (1 Reply)
Hi,
I need to format the output of the command "df -h":
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-lv01
271G 13G 245G 6% /
tmpfs 16G 0 16G 0% /dev/shm
/dev/sda1 97M 50M 43M 55% /boot
/dev/mapper/d1vg-lv01
124G 105G 13G 90% /d0
I used awk:
df -h |... (6 Replies)
Input File
Symmetrix ID : 000192601507
Masking View Name : TS00P22_13E_1
Last updated at : 05:10:18 AM on Tue Mar 22,2011
Initiator Group Name : 10000000c960b9cd
Host Initiators
{
WWN : 10000000c960b9cd
WWN : 10000000c960b9dd
}
Port... (1 Reply)
Hi ,
i am generating some data by firing sql query with connecting to the database by my solaris box.
The below one should be the header line of my excel ,here its coming in separate row.
TO_CHAR(C. CURR_EMP_NO
---------- ---------------
LST_NM... (6 Replies)
Hi All,
I am new to shell scripting, Need your help in creating a shell script which converts any unix command output to JSON format output.
example:
sample df -h command ouput :
Filesystem size used avail capacity Mounted
/dev/dsk/c1t0d0s0 8.1G 4.0G 4.0G 50% /... (13 Replies)
Discussion started by: balu1234
13 Replies
LEARN ABOUT MOJAVE
lreplace
lreplace(n) Tcl Built-In Commands lreplace(n)
__________________________________________________________________________________________________________________________________________________NAME
lreplace - Replace elements in a list with new elements
SYNOPSIS
lreplace list first last ?element element ...?
_________________________________________________________________DESCRIPTION
lreplace returns a new list formed by replacing one or more elements of list with the element arguments. first and last are index values |
specifying the first and last elements of the range to replace. The index values first and last are interpreted the same as index values |
for the command string index, supporting simple index arithmetic and indices relative to the end of the list. 0 refers to the first ele- |
ment of the list, and end refers to the last element of the list. If list is empty, then first and last are ignored.
If first is less than zero, it is considered to refer to before the first element of the list. For non-empty lists, the element indicated
by first must exist or first must indicate before the start of the list.
If last is less than first, then any specified elements will be inserted into the list at the point specified by first with no elements
being deleted.
The element arguments specify zero or more new arguments to be added to the list in place of those that were deleted. Each element argu-
ment will become a separate element of the list. If no element arguments are specified, then the elements between first and last are sim-
ply deleted. If list is empty, any element arguments are added to the end of the list.
EXAMPLES
Replacing an element of a list with another:
% lreplace {a b c d e} 1 1 foo
a foo c d e
Replacing two elements of a list with three:
% lreplace {a b c d e} 1 2 three more elements
a three more elements d e
Deleting the last element from a list in a variable:
% set var {a b c d e}
a b c d e
% set var [lreplace $var end end]
a b c d
A procedure to delete a given element from a list:
proc lremove {listVariable value} {
upvar 1 $listVariable var
set idx [lsearch -exact $var $value]
set var [lreplace $var $idx $idx]
}
SEE ALSO
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lset(n), lrange(n), lsort(n), string(n) |
KEYWORDS
element, list, replace
Tcl 7.4 lreplace(n)