Cutting text from one location to another


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cutting text from one location to another
Prev   Next
# 1  
Old 11-28-2006
Bug Cutting text from one location to another

The following text appears multiple times in a script and it resides in many scripts.
I would like to make the following changes to the text:

Text:
/usr/local/bin/gmail -t abc@yahoo.com -m "this is a test" -f xyz@yahoo.com

I need to cut the text that comes after -m which is "this is a test" and place it in front of the line with echo statment.
I think Awk will not work as -m will not be in the same column everytime.

final result:

echo "this is a test" | /usr/local/bin/gmail -t abc@yahoo.com -m -f xyz@yahoo.com

Any suggestions?

Thank you.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find a existing file location and directory location in Solaris box?

Hi This is my third past and very impressed with previous post replies Hoping the same for below query How to find a existing file location and directory location in solaris box (1 Reply)
Discussion started by: buzzme
1 Replies

2. Shell Programming and Scripting

Insert text line to specific location CSV

In Perl. ***edited question below*** Hey all, I am teaching myself some simple CSV file manipulation and have become a little stuck. Say I have the following layout in the CSV file: age,name,locationIs it possible to INSERT data into the CSV into the correct age order. For example, if I had... (1 Reply)
Discussion started by: whyte_rhyno
1 Replies

3. Shell Programming and Scripting

cutting long text by special char around 100 byte and newline

Regard, How can i cut the text by special char(|) around 100 byte and write the other of the text at newline using Perl. ... (3 Replies)
Discussion started by: Shawn, Lee
3 Replies

4. Shell Programming and Scripting

File created in a different location instead of desired location on using crontab

Hi, I am logging to a linux server through a user "user1" in /home directory. There is a script in a directory in 'root' for which all permissions are available including the directory. This script when executed creates a file in the directory. When the script is added to crontab, on... (1 Reply)
Discussion started by: archana.n
1 Replies

5. Shell Programming and Scripting

Cutting out text from specific portion on filename

Hi, how do I go about cutting out the first numeric characters after the word "access"? access1005101228.merged-00.15.17.86.d8.b8.log.gz (16 Replies)
Discussion started by: GermanJulian
16 Replies

6. Shell Programming and Scripting

Shell Script for Copy files from one location to another location

Create a script that copies files from one specified directory to another specified directory, in the order they were created in the original directory between specified times. Copy the files at a specified interval. (2 Replies)
Discussion started by: allways4u21
2 Replies

7. Shell Programming and Scripting

How to cut first line only from a text near a specific column without cutting a word

First I have to say thank you to this community and this forum. You helped me very much builing several useful scripts. Now, I can't get a solution the following problem, I'm stuck somehow. Maybe someone has an idea. In short, I dump a site via lynx and pipe the output in a file. I need to... (7 Replies)
Discussion started by: lowmaster
7 Replies

8. UNIX for Advanced & Expert Users

copy files from one location to similar location

I need help in forming a script to copy files from one location which has a sub directory structure to another location with similar sub directory structure, say location 1, /home/rick/tmp_files/1-12/00-25/ here 1-12 are the number of sub directories under tmp_files and 00-25 are sub... (1 Reply)
Discussion started by: pharos467
1 Replies

9. HP-UX

replacing text in specific location

i have a file that looks like this: 000000112/01/2008 D99999 000000 12/01/2008 D99999 000000 12/01/2008 1D99999 i need to replace the blanks into 1 for column 7,18-19 how can this be achieved using awk? Thanks. (1 Reply)
Discussion started by: zeontman
1 Replies

10. Shell Programming and Scripting

cutting unwanted text

Hello, I have a log file which looks like this : I want to cut out some text and get printed only : "HTTP GET" and "Time duration: 1013 mls. (1 sec.)" I tried searching the forum for such solution, but I was unable to find it. I also tried awk '/duration/ { print $0 }' mylogfile.log,... (2 Replies)
Discussion started by: sysgate
2 Replies
Login or Register to Ask a Question
DH_INSTALLCATALOGS(1)						     Debhelper						     DH_INSTALLCATALOGS(1)

NAME
dh_installcatalogs - install and register SGML Catalogs SYNOPSIS
dh_installcatalogs [debhelperoptions] [-n] DESCRIPTION
dh_installcatalogs is a debhelper program that installs and registers SGML catalogs. It complies with the Debian XML/SGML policy. Catalogs will be registered in a supercatalog, in /etc/sgml/package.cat. This command automatically adds maintainer script snippets for registering and unregistering the catalogs and supercatalogs (unless -n is used). These snippets are inserted into the maintainer scripts and the triggers file by dh_installdeb; see dh_installdeb(1) for an explanation of Debhelper maintainer script snippets. A dependency on sgml-base will be added to ${misc:Depends}, so be sure your package uses that variable in debian/control. FILES
debian/package.sgmlcatalogs Lists the catalogs to be installed per package. Each line in that file should be of the form "source dest", where source indicates where the catalog resides in the source tree, and dest indicates the destination location for the catalog under the package build area. dest should start with /usr/share/sgml/. OPTIONS
-n, --no-scripts Do not modify postinst/postrm/prerm scripts nor add an activation trigger. NOTES
Note that this command is not idempotent. dh_prep(1) should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. SEE ALSO
debhelper(7) /usr/share/doc/sgml-base-doc/ AUTHOR
Adam Di Carlo <aph@debian.org> 11.1.6ubuntu2 2018-05-10 DH_INSTALLCATALOGS(1)