Sponsored Content
Full Discussion: sed problems - Bash Script
Top Forums Shell Programming and Scripting sed problems - Bash Script Post 302996022 by MadeInGermany on Monday 17th of April 2017 03:01:22 PM
Old 04-17-2017
The closing / are missing. For example
Code:
    sed -i "
      10s/.*/mail=$mailgmail/
      23s/.*/mailhub=$mailgmail/
      28s/.*/mailhub=$mailgmail/
    " /etc/ssmtp/ssmtp.conf

Multi-statement per one sed is more efficient.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problems writing bash script to unzip files

I'm getting the following errors when I try to write a script to unzip some zip files. When I use the free trial copy of the commerical winzip program, however, they work fine. When I use -l or -t on unzip it indicates no errors. When I use the -o switch interactively from the bash command line it... (1 Reply)
Discussion started by: siegfried
1 Replies

2. Shell Programming and Scripting

unzip via bash startup script problems

i have two lines in my rc.local file that are wget -O/<path>/<file>.zip url://domain.com unzip -o /<path>/<file>.zip the wget works fine, but the unzip won't work. when i copy/pase the unzip line to the prompt it works fine. i thought that maybe the unzip was running before the wget... (0 Replies)
Discussion started by: easysnowboards
0 Replies

3. Shell Programming and Scripting

problems with sed and bash. Escaped characters ?

Hi, I'm writing a long script for bash (on RHEL 5.0) to execute many commands. So, my idea is to create a function to deal with error checking and logging (see ceckoutput() below). This works with all commands except for sed. I think it may be a problems with escaped characters. So I did the... (4 Replies)
Discussion started by: macL
4 Replies

4. UNIX for Dummies Questions & Answers

Problems in shell script if sed is used

Hi All, Below is the script which i have written in cygwin: #!/usr/bin/sh fname=$1 cat $fname | sed 's/ //g' > fname1 for i in `cat $fname1` do echo $i > file1 #param1 is script name param1=`awk -F , '{print $1}' file1` param1="$param1.sql" #param2 is BL param2=`awk -F , '{print... (5 Replies)
Discussion started by: janardhanamk
5 Replies

5. Shell Programming and Scripting

Problems editing file with awk in bash script

Hello dear users, here I have a script to manipulate .csv files that are like this originally: And I need to make a script to delete certain fields. Each field is separated with a comma. So, here is my script (at least a part of it): Field $1 is composed of a name, and then a... (5 Replies)
Discussion started by: sr00t
5 Replies

6. Shell Programming and Scripting

Execution Problems with bash script

Hello, can someone please help me to fix this script, I have a 2 files, one file has hostname information and second file has console information of the hosts in each line, I have written a script which actually reads each line in hostname file and should grep in the console file and paste the... (8 Replies)
Discussion started by: bobby320
8 Replies

7. Shell Programming and Scripting

Execution problems with BASH Shell Script

Hi I need help with my coding , first time I'm working with bash . What i must do is check if there is 3 .txt files if there is not 3 of them i must give an error code , if al three is there i must first arrange them in alphabetical order and then take the last word in al 3 of the .txt files... (1 Reply)
Discussion started by: linux newb
1 Replies

8. Shell Programming and Scripting

Sed, bash problems migrating from Cray to GNU/Linux

So, I have a series of ASCII files, all named something like mrkxxxxz.tmp (say, mrk1001z.tmp, mrk1002z.tmp, mrk1003z.tmp,...) -- these are .tmp files created by a large simulation program, and each different .tmp file represents a different parameter space used in the simulation). The simulations... (2 Replies)
Discussion started by: johnny_canucl
2 Replies

9. Shell Programming and Scripting

Bash script having variable substitution problems

Hi I am setting the variables like this : setenv MODULE1 modem5__3 setenv MODULE2 modem5__2 setenv MODULE3 modem_ctrl_1_1 setenv MODULE4 modem_1_0 setenv COUNT 10 I am having a bash script as shown below ################################################ #!/bin/bash for ((... (5 Replies)
Discussion started by: kshitij
5 Replies

10. UNIX for Beginners Questions & Answers

Bash script problems int to binary

Hi, I am trying to do a bash script that convert a decimal number to a binary value, but it doesn't work... To begin, I am just trying to convert a positive number to 8 bits binary. read -p"Entrez un nombre entre -128 et 127 pour l'encoder en binaire: " number binaryValues=(128 64 32 16 8 4 2... (8 Replies)
Discussion started by: Zedki
8 Replies
SSMTP(8)						      System Manager's Manual							  SSMTP(8)

NAME
ssmtp, sendmail - send a message using smtp SYNOPSIS
ssmtp [ flags ] [ address ... ] /usr/lib/sendmail [ flags ] [ address ... ] DESCRIPTION
ssmtp is a send-only sendmail emulator for machines which normally pick their mail up from a centralized mailhub (via pop, imap, nfs mounts or other means). It provides the functionality required for humans and programs to send mail via the standard or /usr/bin/mail user agents. It accepts a mail stream on standard input with recipients specified on the command line and synchronously forwards the message to the mail transfer agent of a mailhub for the mailhub MTA to process. Failed messages are placed in dead.letter in the sender's home directory. Config files allow one to specify the address to receive mail from root, daemon, etc.; a default mailhub; a default domain to be used in From: lines; and per-user From: addresses and mailhub names. It does not attempt to provide all the functionality of sendmail: it is intended for use where other programs are the primary means of at last mail delivery. It is usefull with pop/imap, or to simulate the Sun shared mail spool option for non-Sun machines, for machines whose sendmails are too difficult (or various) to configure, for machines with known disfeatures in their sendmails or for ones where there are ``mysterious problems''. It does not do aliasing, which must be done either in the user agent or on the mailhub. Nor does it honor .forwards, which have to be done on the recieving host. It especially does not deliver to pipelines. OPTIONS
Most sendmail options are irrelevent to sSMTP. Those marked ``ignored'' or ``default'' have no effect on mail transfer. Those marked ``unsupported'' are fatal errors. Those marked ``simulated'' are not errors, but the result is for the program to exit with an informative message. A sort of fatal non-error. -4 Forces ssmtp to use IPv4 addresses only. -6 Forces ssmtp to use IPv6 addresses only. -auusername Specifies username for SMTP authentication. -appassword Specifies password for SMTP authentication. -ammechanism Specifies mechanism for SMTP authentication. (Only LOGIN and CRAM-MD5) -ba (unsupported) ARPANET mode. All input lines must end with a LINEFEED, and all messages will be generated with a CR-LF at the end. Also, the ``From:'' and ``Sender:'' fields are examined for the name of the sender. -bd (unsupported) Run as a daemon. -bi (ignored) Initialise the alias database. -bm (default) Deliver mail in the usual way. -bp (simulated) Print a summary of the mail queue. -bs (unsupported) Read SMTP commands from stdin. -bt (unsupported) Run in address test mode. -bv (unsupported) Verify names only. -bz (unsupported) Create the configuration freeze file. -Cfile Use alternate configuration file. -dX Set debugging value to X. -E (ignored) Don't trust userid of sender. -Ffullname Set the full name of the sender. -fname Sets the name of the ``from'' person. This option is valid only if no From: line is specified within the header of the email. -h (ignored) Set the hop count to N. -m (ignored) Ignore originator in alias. -Mid (ignored) Attempt to deliver the queued message with message-id id. -N dsn (ignored) Set delivery status notification conditions to dsn. -n (default) Do not do aliasing. -oAfile (ignored) Use alternate alias file. -oc (ignored) Delay ``expensive'' connections. -od (ignored) Set the delivery mode to interactive/synchronous, background or queue (Always interactive). -oD (ignored) Run newaliases if required. -oe (ignored) Set error processing to mail, write, print or quit. (Always print). -oFmode (ignored) The mode to use when creating temporary files. -of (ignored) Save UNIX-system-style ``From'' lines at the front of messages. -ogN (ignored) Set group ID to use when calling mailers. -oHfile (ignored) Set SMTP help file. -oi (default) Do not take dots on a line by themselves as a message terminator. -oLn (ignored) The log level. -om (default) Send to ``me'' (the sender) also if in an alias. -oo (unsupported) If set, this message may have old style headers. -oQqueuedir (ignored) Select the directory in which to queue messages. -ortimeout (ignored) The timeout on reads. -oSfile (ignored) Save statistics in the named file. -os (ignored) Always instantiate the queue. -oTtime (ignored) Set timeout on messages. -otstz,dtz (ignored) Set the name of the time zone. -ouN (ignored) Set the default user id for mailers. -q[time] (simulated) Process the queue. -rname Same as -f. -Rstring (ignored) Process queue for recipient. -R return (ignored) Set the amount of the message to be returned if the message bounces. -t Read message, searching for recipients. ``To:'', `Cc:'', and ``Bcc:'' lines will be scanned for people to send to. Any addresses in the argument list will be suppressed (not supported). -v Go into verbose mode. -V Say version and quit. REVERSE ALIASES
A reverse alias gives the From: address placed on a user's outgoing messages and (optionally) the mailhub these messages will be sent through. Example: root:jdoe@isp.com:mail.isp.com Messages root sends will be identified as from jdoe@isp.com and sent through mail.isp.com. FILES
/etc/ssmtp/ssmtp.conf - configuration file /etc/ssmtp/revaliases - reverse aliases file SEE ALSO
RFC821, RFC822, ssmtp.conf(5). AUTHORS
Matt Ryan (mryan@debian.org) Hugo Haas (hugo@debian.org) Christoph Lameter (clameter@debian.org) Dave Collier-Brown (davecb@hobbes.ss.org) BUGS
sSMTP does not support exception lists to the -t option (never seen it used). sSMTP will fail if the mailhub is unreachable. Last change: 4 February 2005 SSMTP(8)
All times are GMT -4. The time now is 08:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy