07-08-2019
Thank you I will try using that as well!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have attached a file with few records. First 2 characters of each record are binary characters. I can remove it by
and it works fine. But
is behaving differently and removing more than expected characters. Can someone help me in accomplishing it through sed? Thanks in advance. (13 Replies)
Discussion started by: amicon007
13 Replies
2. UNIX for Dummies Questions & Answers
Can anyone give detailed and example for sed -i option.
Where can we use this option?:) (3 Replies)
Discussion started by: gwgreen1
3 Replies
3. Shell Programming and Scripting
Hi,
What does the following command do on files?
sed '1b; $d'
To me it just deletes the last line of the file. If so what is the significance of sed's 'b' option?
Thanks (1 Reply)
Discussion started by: royalibrahim
1 Replies
4. Shell Programming and Scripting
Hi, all.
Here's the problem:
sed '/FOO/,/BAR/p'
That should print anything between FOO and BAR, right?
Well, let's say I have file.txt that contains just one line "how are you today?".
Then I run something like the above and get:
$ sed '/how/,/today/p' file.txt
how are you... (9 Replies)
Discussion started by: pereyrax
9 Replies
5. Shell Programming and Scripting
sed "s/^/8,A1,$dat,id2_3,/g" -e sed "s/$/,,,,,,,,,,,/g" temporary
wn m running this script m getting a error... plz help me with this....
O/p
sed: -e expression #1, char 3: unterminated `s' command
---------- Post updated at 11:35 AM ---------- Previous update was at 11:33 AM... (7 Replies)
Discussion started by: nikhil jain
7 Replies
6. Shell Programming and Scripting
Hi i am facing problem with sed -n option could you please help me on this, i have a file test the contents of the file is
width="75">10/0 4/12</td>^M><a href='courtorders/100412zr.pdf' target="_blank">Miscellaneous Order</a></td>^M width="75">10/01/12</td>^M><a href='courtorde... (8 Replies)
Discussion started by: ragilla
8 Replies
7. Shell Programming and Scripting
Hi,
I have the following command.(Delete all trailing blank lines at the end of a file.)
sed -e :a -e '/^\n*$/{$d;N;ba' -e '}'
I don't understand the logic of this command and also I don't understand why -e is used.
Can you please let me know the logic of this command and why three -e... (5 Replies)
Discussion started by: TomG
5 Replies
8. Solaris
I accidentally saved a txt file in vi with the name ":q!".
no amount of regex tomfoolery I can think of will allow me to remove the file.
anyone got any ideas? (4 Replies)
Discussion started by: os2mac
4 Replies
9. Shell Programming and Scripting
I have 4000 files like
$cat clus_grp_seq10_g.phy
18 1002
anig_OJJ65951_1 ATGGTTTCGCAGCGTGATAGAGAATTGTTTAGGGATGATATTCGCTCGCGAGGAACGAAGCTCAATGCTGCCGAGCGCGAGAGTCTGCTAAGGCCATATCTGCCAGATCCGTCTGACCTTCCACGCAGGCCACTTCAGCGGCGCAAGAAGGTTCCTCG
aver_OOF92921_1 ... (1 Reply)
Discussion started by: sammy777888
1 Replies
10. UNIX for Beginners Questions & Answers
Hi I'm having a problem with a sed command that I thought I was using correctly but apparently that's not the case.
I was hoping someone here could point out what it is I am doing wrong?
I am using the print, no print option for a matched pattern in sed. Everything seemed to be working fine... (2 Replies)
Discussion started by: harveyclayton
2 Replies
LEARN ABOUT DEBIAN
shtool-subst
SHTOOL-SUBST.TMP(1) GNU Portable Shell Tool SHTOOL-SUBST.TMP(1)
NAME
shtool-subst - GNU shtool sed(1) substitution operations
SYNOPSIS
shtool subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup ext]
[-e|--exec cmd] [-f|--file cmd-file] [file] [file ...]
DESCRIPTION
This command applies one or more sed(1) substitution operations to stdin or any number of files.
OPTIONS
The following command line options are available.
-v, --verbose
Display some processing information.
-t, --trace
Enable the output of the essential shell commands which are executed.
-n, --nop
No operation mode. Actual execution of the essential shell commands which would be executed is suppressed.
-w, --warning
Show warning on substitution operation resulting in no content change on every file. The default is to show a warning on substitution
operations resulted in no content change on all files.
-q, --quiet
Suppress warning on substitution operation resulting in no content change.
-s, --stealth
Stealth operation. Preserve timestamp on file.
-i, --interactive
Enter interactive mode where the user has to approve each operation.
-b, --backup ext
Preserve backup of original file using file name extension ext. Default is to overwrite the original file.
-e, --exec cmd
Specify sed(1) command directly.
-f, --file cmd-file
Read sed(1) command from file.
EXAMPLE
# shell script
shtool subst -i -e 's;(c) ([0-9]*)-2000;(c) 1-2001;' *.[ch]
# RPM spec-file
%install
shtool subst -v -n
-e 's;^(prefix=).*;1 $RPM_BUILD_ROOT%{_prefix};g'
-e 's;^(sysconfdir=).*;1 $RPM_BUILD_ROOT%{_prefix}/etc;g'
`find . -name Makefile -print`
make install
HISTORY
The GNU shtool subst command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 2001 for GNU shtool. It was prompted
by the need to have a uniform and convenient patching frontend to sed(1) operations in the OpenPKG package specifications.
SEE ALSO
shtool(1), sed(1).
18-Jul-2008 shtool 2.0.8 SHTOOL-SUBST.TMP(1)