09-18-2019
Thanks RudiC. This worked perfectly well.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Below an example of what I mean. The first attempt does what I want; the second doesn't, because bash assumes a line break means the end of an individual "command unix". Is there some way that I can convince bash to parse out, eg, to the closing parenthesis?
I'm thinking this would allow for... (1 Reply)
Discussion started by: tphyahoo
1 Replies
2. Shell Programming and Scripting
I have several huge files wich contains oracle table creation scripts as follows:
I would need to remove the pattern colored in red above. Any sed/awk/pearl code will be of much help.
Thanks (2 Replies)
Discussion started by: sabyasm
2 Replies
3. Shell Programming and Scripting
Hi All,
I have named a file with current date,time and year as follows:
month=`date | awk '{print $2}'`
date=`date | awk '{print $3}'`
year=`date | awk '{print $6}'`
time=`date +%Hh_%Mm_%Ss'`
filename="test_"$month"_"$date"_"$year"_"$time".txt"
> $filename
The file is created with a... (2 Replies)
Discussion started by: amio
2 Replies
4. Shell Programming and Scripting
Hi All,
We append the output of a file's size in a file. But a newline character is appended after the variable.
Pls help how to clear this.
filesize=`ls -l test.txt | awk `{print $5}'`
echo File size of test.txt is $filesize bytes >> logfile.txt
The output we got is,
File size of... (4 Replies)
Discussion started by: amio
4 Replies
5. Shell Programming and Scripting
Hi All,
I have 5000 records like this
Request_id|Type|Status|Priority|Ticket Submitted Date and Time|Actual Resolved Date and Time|Current Ticket Owner Group|Case final Ticket Owner Group|Customer Severity|Reported Symptom/Request|Component|Hot Topic|Reason for Missed SLA|Current Ticket... (2 Replies)
Discussion started by: j_53933
2 Replies
6. Shell Programming and Scripting
Hello all,
first off great forum.
Now for my little problem.
Using RHEL 5.4 and awk. Been doing code since a few month. So just starting.
My problem is handeling data on multiple lines.
{
if ($1 != LASTKEY && h ~ /.*\/s_fr_/) {
checkgecos( h, h )
h=""
... (2 Replies)
Discussion started by: maverick72
2 Replies
7. Shell Programming and Scripting
Hi,
In my file, I have '\n' characters inside a single record. Because of this, a single records appears in many lines and looks like multiple records. In the below file.
File 1
====
1,nmae,lctn,da\n
t
2,ghjik,o\n
ut,de\n
fk
Expected output after the \n removed
File 2
=====... (5 Replies)
Discussion started by: machomaddy
5 Replies
8. Shell Programming and Scripting
hi i am having delimited .dat file having content like below.
test.dat(5 line of records)
======
PT2~Stag~Pt2 Stag Test.
Updated~PT2 S T~Area~~UNCEF R20~~2012-05-24 ~2014-05-24~~
PT2~Stag y~Pt2 Stag Test.
Updated~PT2 S T~Area~METR~~~2012-05-24~2014-05-24~~test
PT2~Pt2 Stag Test~~PT2 S... (4 Replies)
Discussion started by: sushine11
4 Replies
9. Shell Programming and Scripting
Hi all..
I have a text file which looks like below:
abcd
efgh
ijkl
(blank space)
I need to remove only the last (blank space) from the file. When I try wc -l the file name,the number of lines coming is 3 only, however blank space is there in the file.
I have tried options like... (14 Replies)
Discussion started by: Sathya83aa
14 Replies
10. Shell Programming and Scripting
I have a file which comes every day and the file data look's as below.
Vi abc.txt
a|b|c|d\n
a|g|h|j\n
Some times we receive the file with only a new line character in the file like
vi abc.txt
\n (8 Replies)
Discussion started by: rak Kundra
8 Replies
LEARN ABOUT OSX
rwbytype.d
rwbytype.d(1m) USER COMMANDS rwbytype.d(1m)
NAME
rwbytype.d - read/write bytes by vnode type. Uses DTrace.
SYNOPSIS
rwbytype.d
DESCRIPTION
This program identifies the vnode type of read/write activity - whether that is for regular files, sockets, character special devices, etc.
This is measuring at the application level, so file activity may well be cached by the system.
Since this uses DTrace, only users with root privileges can run this command.
EXAMPLES
This samples until Ctrl-C is hit.
# rwbytype.d
FIELDS
PID process ID
CMD process name
VNODE vnode type (describes I/O type)
DIR direction, Read or Write
BYTES total bytes
DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver-
bose descriptions explaining the output.
EXIT
rwbytype.d will sample until Ctrl-C is hit.
AUTHOR
Brendan Gregg [Sydney, Australia]
SEE ALSO
rwbypid.d(1M), rwbbypid.d(1M), dtrace(1M)
version 0.70 Jan 11, 2006 rwbytype.d(1m)