Echo "abc" | sed - r 's/a/&_&/


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Echo "abc" | sed - r 's/a/&_&/
# 1  
Old 11-06-2019
Echo "abc" | sed - r 's/a/&_&/

I want to know the working of & here step by step using sed command.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

what does "&" do in this sed command

I want to know the working of & here step by step using sed command: echo "abc" | sed - r 's/a/&_&/' (2 Replies)
Discussion started by: Preeti07
2 Replies

2. Web Development

How would I mod_rewrite "/~a1Pha" and "/=a1Pha" to "/paste/a1Pha.htm"? (internally & externally)

Basically I want to shorten URLs on my html pasting site (pasteht.ml), by using "/~a1Pha" instead of "/paste/a1Pha". The ID is 5 numbers and letters, both cases. For example: /~idnum serves /paste/idnum.htm /=idnum serves /paste/idnum.htm /paste/idnum redirects to /~idnum (to update any old... (0 Replies)
Discussion started by: phillips1012
0 Replies

3. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

Hi all. I have a .txt file that I need to sort it My file is like: 1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO) 2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies

4. Shell Programming and Scripting

Replace dashes positions 351-357 & 024-043 with 0 & replace " " if exis with 04 at position 381-382

I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Discussion started by: lancesunny
11 Replies

5. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

6. Shell Programming and Scripting

Manipulate "&" in sed

Is it possible to manipulate the ampersand in sed? I want to sum +1 to all numbers in a file. Example that doesn't work:sed "s/\{1,2\}/$(expr & + 1)/g" filenameAlso, how to return 02 instead of 2 from expr? (8 Replies)
Discussion started by: teresaejunior
8 Replies

7. Shell Programming and Scripting

What does this really mean? "tty -s && stty istrip"

I am having hard time understanding what this really do to the environment? I do understand this part "tty -s && stty " but not "istrip" # stty command is executed only if a tty is attached to the process. # stty istrip : Strip input characters to 7 bits tty -s && stty istrip I am... (3 Replies)
Discussion started by: kchinnam
3 Replies

8. Shell Programming and Scripting

Append && echo "success" to all commands

I am learning to build from SVN and other tools, with a lot of copying and pasting from forums. I like to append && echo "success" to all commands so that I can see at a glance if things went all right. Is there a way that I can have the bash shell append this to all commands? Thanks! (5 Replies)
Discussion started by: dotancohen
5 Replies

9. Shell Programming and Scripting

"sed" to check file size & echo " " to destination file

Hi, I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Discussion started by: jockey007
7 Replies

10. What is on Your Mind?

[[ $(date +%Y) == 2007 ]] && echo "Happy New Year"

Same as the Title! :) (2 Replies)
Discussion started by: ripat
2 Replies
Login or Register to Ask a Question
SHTOOL-INSTALL.TMP(1)					      GNU Portable Shell Tool					     SHTOOL-INSTALL.TMP(1)

NAME
shtool-install - GNU shtool install(1) command SYNOPSIS
shtool install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode mode] [-o|--owner owner] [-g|--group group] [-e|--exec sed-cmd] file [file ...] path DESCRIPTION
This command installs a one or more files to a given target path providing all important options of the BSD install(1) command. The trick is that the functionality is provided in a portable way. 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. -d, --mkdir To maximize BSD compatiblity, the BSD "shtool "install -d"" usage is internally mapped to the "shtool "mkdir -f -p -m 755"" command. -c, --copy Copy the file to the target path. Default is to move. -C, --compare-copy Same as -c except if the destination file already exists and is identical to the source file, no installation is done and the target remains untouched. -s, --strip This option strips program executables during the installation, see strip(1). Default is to install verbatim. -m, --mode mode The file mode applied to the target, see chmod(1). Setting mode to ""-"" skips this step and leaves the operating system default which is usually based on umask(1). Some file modes require superuser privileges to be set. Default is 0755. -o, --owner owner The file owner name or id applied to the target, see chown(1). This option requires superuser privileges to execute. Default is to skip this step and leave the operating system default which is usually based on the executing uid or the parent setuid directory. -g, --group group The file group name or id applied to the target, see chgrp(1). This option requires superuser privileges to execute to the fullest extend, otherwise the choice of group is limited on most operating systems. Default is to skip this step and leave the operating system default which is usually based on the executing gid or the parent setgid directory. -e, --exec sed-cmd This option can be used one or multiple times to apply one or more sed(1) commands to the file contents during installation. EXAMPLE
# Makefile install: : shtool install -c -s -m 4755 foo $(bindir)/ shtool install -c -m 644 foo.man $(mandir)/man1/foo.1 shtool install -c -m 644 -e "s/@p@/$prefix/g" foo.conf $(etcdir)/ HISTORY
The GNU shtool install command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1997 for GNU shtool. It was prompted by portability issues in the installation procedures of OSSP libraries. SEE ALSO
shtool(1), umask(1), chmod(1), chown(1), chgrp(1), strip(1), sed(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-INSTALL.TMP(1)