Search Results

Search: Posts Made By: cleanden
6,869
Posted By cleanden
I had to tweak your code a little to account for...
I had to tweak your code a little to account for 2 lines having @LOCALDOMAIN in them:

but other than that, you got me exactly what I wanted.
Thanks!
6,869
Posted By cleanden
Thanks but this has 2 problems: 1. It seems to...
Thanks but this has 2 problems:
1. It seems to be printing 1 line of the result for each line of the file
2. I'm trying to get the value into a String Variable within a script so that I can later...
6,869
Posted By cleanden
The point that I guess I failed to make is that...
The point that I guess I failed to make is that postmaster is not a static piece of text - it could be anything, but I know it always precedes @LOCALDOMAIN
6,869
Posted By cleanden
That line is in a file and ultimately I need to...
That line is in a file and ultimately I need to get to 'postmaster'
I can do it by hard-coding that line into a variable but I cannot figure out the grep cut command to get it out of the file.
6,869
Posted By cleanden
String extraction from a text file
The following script code works great for extracting 'postmaster' from a line of text stored in a variable named string:
string="PenaltyError:=554 5.7.1 Error, send your mail to...
37,507
Posted By cleanden
That worked! My only problem is that I don't...
That worked!

My only problem is that I don't have that line of text as a fixed variable, so how would I now extract it from a text file into the variable named string instead of using my existing...
37,507
Posted By cleanden
I must be missing something. I copied and pasted...
I must be missing something. I copied and pasted that code into my script, commented everything else out and it comes back with nothing.
37,507
Posted By cleanden
Switching the cuts and removing the -d ' ' gives...
Switching the cuts and removing the -d ' ' gives me:
PenaltyError:=554 5.7.1 Error, send your mail to postmaster
It's supposed to just say postmaster

Doing the eval was my way of managing to get...
37,507
Posted By cleanden
Thanks for that. It's working now, but only to a...
Thanks for that. It's working now, but only to a point.

works, but my actual code:

does not. This is what is returning:
-f8": command not found
Something about my eval is breaking it, but...
37,507
Posted By cleanden
Can't get it to run the same as you - very...
Can't get it to run the same as you - very strange.
I wonder if the 'space' is actually something else or being interpreted differently.
Is there a command to say give me the last 'word' of a line?...
37,507
Posted By cleanden
Problem Using Cut With A Space Delimiter
I am trying to extract 'postmaster' from the following string:
PenaltyError:=554 5.7.1 Error, send your mail to postmaster@LOCALDOMAIN
using the following command:
cat /usr/share/assp/assp.cfg |...
Forum: IP Networking 04-12-2009
7,319
Posted By cleanden
Switching from DHCP to Static IP
I am trying to write a set of scripts for my Ubuntu 810 Server to allow a user to change from DHCP to a user-supplied Static IP, Subnet, Gateway and DNS Servers.

So far I have the following, where...
5,025
Posted By cleanden
Wonderful! Thanks!
Wonderful!
Thanks!
5,025
Posted By cleanden
Extracting Data Using SED
Given the following text in a file named extract.txt:
listenPort:=25
smtpDestination:=2
enableSSL:=

I am trying to extract only the value 2 following smtpDestination:=

Someone had suggested...
3,821
Posted By cleanden
It's not quite right I think - it's printing out...
It's not quite right I think - it's printing out the whole alex.cfg.

My script looks like this:

Am I doing something wrong?

Thanks,
Alex
3,821
Posted By cleanden
Perfect! Thanks everyone! Last question I...
Perfect! Thanks everyone!

Last question I promise. How can I read and extract the existing data so I can show it to the user before they change it?

So for example, how would I extract...
3,821
Posted By cleanden
That's not working for me. Here are some...
That's not working for me. Here are some specifics:

Existing line:
smtpDestination:=125

Command Run:
sed -e "s/smtpDestination:=/smtpDestination:=localhost:25/" alex.cfg > alex2.cfg

New...
3,821
Posted By cleanden
Wow, thank you both for such fast responses. ...
Wow, thank you both for such fast responses.

That is a great help, but my only remaining problem is that I don't know what will come after Variable1:, Variable2:, etc
They may have already run...
3,821
Posted By cleanden
How to replace text in a file with text entered
I am trying to write a shell script that will allow the typing of a value, then using that value to replace data in a text file.
I suspect I need sed.

The format of the file is:
Variable1:Value1...
Showing results 1 to 19 of 19

 
All times are GMT -4. The time now is 08:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy