I'm guessing that bash's built-in echo command isn't treating \007 the way you'd like. I personally find that echo varies so widely between systems/shells that I avoid using it at all possible costs. I also do not advocate breaking a sed string to "insert" shell generated text -- hard to maintain in my humble opnion.
If I were doing it, I'd tackle it this way as it should work regardless of shell:
This replaces the "** with the bell character (7) and then prints the record.
Also, I'm sure someone will chime in that your use of cat is unnecessary as sed can read the input file directly, so I'll point it out:
No need to cat the file and pipe to sed -- not efficient.
Last edited by agama; 07-29-2011 at 11:06 PM..
Reason: clarification
I have a loop in a script that is given me an error but, when I do it on the command line it works perfectly. The sed statement has to use the variables from a file so the file is partitioned correctly. I am running on HP:
<Begin error>:
+ cat /u01/bteam/CNAM/1121/.partition
+ read line
+ +... (3 Replies)
Can anyone tell me ...on the below listed command
cat /mnt/winbox/list_measurement/ds1c/ds1_f.rome_27A03A 2>> error_log | sed -e '1,3d;s/^/27A03A,/' | sed -e "s#\(.*\)#\1 ,$(date +%Y-%m-%d)#g" > /SBS/ds1_f.rome_27A03A
The outcome is this:
,2005-08-29 Forestdale,3:02 am MON AUG 29,... (9 Replies)
Can someone help me "port" this to AIX sed?
sed '/nas/{n;s/true/false/}'
I know it doesn't like the ; but i don't know how else to do it.... never had to sed on an AIX box :D (7 Replies)
Hi All
I'm getting this error while executing a sed script
sed: 0602-404 Function /</ i\ File from New Cube: cannot be parsed.
sed "/</ i\ File from New Cube:
/>/ i\ File from Old Cube:" difference1.txt > Difference.txt
I've a file like this
< Y2008 Dec ..... .... ... 345
I want... (6 Replies)
Hello ,
I am trying to replace a word :: complete to Failed .
work: complete
Sed command which i am using is given below ::
sed s/work: complete/Failed/g temp1.txt > temp2.txt (Sed command is grabled if i use the above .. because of space which is there between work: and complete. I... (6 Replies)
Hi,
I am trying to use 3 sed statements in a shell script, but it get foll error.
sed : garbage after command.
If I use only two sed statements, the script works well.
Is there any restriction for sed usage or is there some catch which I am missing.
Sample Script is as follows :
... (3 Replies)
Hi guys. Can somone advise as to what the problem is with the following sed command?
1) read -p "Please enter new username you wish to replace old: " new_username
sed "s/$username/$new_username/" information_file
;;
This is one of the case statements included but I'm... (1 Reply)
I can't get this code to work, could I get some help...
sed -i '' "s:${shLogpath1}${cell}:${shLogpath2}${cell}:g" test.txt
Any Ideas, I think I need to separate the variables some how? (2 Replies)
I'm trying to change a date in a couple of large files using SED. The problem is when I use the -n parameter, it doesn't actually change the file. When I leave out the -n, it sends the whole file to the screen, but it does appear to change it.
The problem is, these files are very large and it... (8 Replies)
Discussion started by: Drenhead
8 Replies
LEARN ABOUT PHP
acctmerg
acctmerg(1M) System Administration Commands acctmerg(1M)NAME
acctmerg - merge or add total accounting files
SYNOPSIS
/usr/lib/acct/acctmerg [-a] [-i] [-p] [-t] [-u] [-v] [filename] ...
DESCRIPTION
acctmerg reads its standard input and up to nine additional files, all in the tacct format (see acct.h(3HEAD)) or an ASCII version thereof.
It merges these inputs by adding records whose keys (normally user ID and name) are identical, and expects the inputs to be sorted on those
keys.
OPTIONS -a Produce output in ASCII version of tacct.
-i Produce input in ASCII version of tacct.
-p Print input with no processing.
-t Produce a single record that totals all input.
-u Summarize by user ID, rather than by user ID and name.
-v Produce output in verbose ASCII format, with more precise notation for floating-point numbers.
EXAMPLES
Example 1: Using the acctmerg command.
The following sequence is useful for making "repairs" to any file kept in this format:
example% acctmerg -v <filename1>filename2
Edit filename2 as you want:
example% acctmerg -i <filename2>filename1
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWaccu |
+-----------------------------+-----------------------------+
SEE ALSO acctcom(1), acct(1M), acctcms(1M), acctcon(1M), acctprc(1M), acctsh(1M), fwtmp(1M), runacct(1M), acct(2), acct.h(3HEAD), utmpx(4),
attributes(5)
System Administration Guide: Basic Administration
SunOS 5.10 22 Feb 1999 acctmerg(1M)