By just adding the Key= string in front:
You could do so in sed by adding the substitution s/^/Key=/. But: using sed in a "command substitution" requires an expensive process creation, while variable expansion is done within the shell only.
Hi
can u pls help me out with this as
i am relatively new to unix.
I need to use 4 different types of dates in my shell script
* first day of the last(previous) month
* last day of the last(previous) month
* first day of the current month
* (sysdate-1) yesterday's date for the current... (5 Replies)
Hi everybody:
I have a problem. I have a output files which have this pattern:
number1
--space
block1a - 7rows/10columns/65elements
--space
block1b - 7rows/10columns/65elements
--space
block1c - 7rows/10columns/65elements
--space
number2
--space
block2a - 7rows/10columns/65elements... (0 Replies)
Hi, I have a slight problem in trying to manipulate the text within a file using the "sed" command in that the text i need changed has "/" slashes in.
I have a .sh script that scans the "/db/sybbackup/" directories for any .dmp file older than 2 days and then to >> the information to a file called... (3 Replies)
Hi guys, I was wandering if a Shell guru could give me some advice on tackling a problem.
I have used a mixture of grep, cut and awk to get data from a log file in the following format:
14/11/08 10:39: Checking currenly : Enabled
14/11/08 10:39: Records allocated : 221... (11 Replies)
Hey guys.. I am not sure if this is the right place to post this - but here goes. I need to manipulate an openldap export to match a different schema so that I can import into that system. Basically - its just text manipulation. I have gotten alot of it done just by using simple sed, but I am sorta... (0 Replies)
I have a simple txt files that looks something like this (The title is a part of the text file)
Student Grades
---------------
1 Tim Purser 89
2 John Wayne 56
3 Jenn Hawkins 95
4 Harry Potter 75
Here are my questions:
How would I ONLY print the names of students... (2 Replies)
Hi All,
I have a file like below and i have 2 questions on this (They are 3 lines starts with 01 , 02 and 03. but is
01abc333644554 234 2334535 34534535355353 sfsdf345455
353 4543 jgkg tty 7676
02cdesdfsdfsdf 234 wesdfsdf 345345 234234 234234 2342342 dfgdfg
sdfgg dgdgdg fgvfs... (6 Replies)
Hello,
How can I remove partial duplicates and manipulate text in bash using either awk, grep or sed? Thanks.
Input:
ted,"foo,bar,zoo"
john-son,"foot,ben,zoo"
bob,"bar,foot"
Expected Output:
foo,ted
bar,ted
zoo,ted
foot,john-son
ben,john-son (4 Replies)
I attached both picturehttps://1drv.ms/t/s!Aoomvi55MLAQh1jODfUxa-xurns_ and *.txt file of a sample work file. In this file Reactions which only start with "r1f", "r2f", "r3f"......and so on. And for each reaction the reaction rates is situated couple of lines later with a "+" sign.
For each... (1 Reply)
Hi All,
I have a working script as below.
echo "Files loaded with $(cat /var/tmp/script.X1.out)" | mail -s "Files loaded with return code" mailid
This script takes the output from script.X1.out file and appends the text "Files loaded with return code" and sends the email. Now what I want... (5 Replies)
Discussion started by: midhun3108
5 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)