|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Delete to eol after pattern with sed
working on interactive ftp script saving log and want to remove the password from log so Code:
"quote PASS foofoo" would become Code:
"quote PASS XXXXXXX" replacing or removing the password is of no matter have tried several sed commands but have only been successful with character matching not pattern thanks pp Last edited by jim mcnamara; 11-19-2012 at 06:28 PM.. |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
what exactly have you tried and failed?
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
various attempts now trying to work with Code:
sed s/PASS[^PASS]*$// as a starting point it will do in a pinch but really what i want never mind Code:
sed s/[^PASS]*$// works needed to get my thoughts right thanks ---------- Post updated at 04:01 PM ---------- Previous update was at 01:48 PM ---------- correction Code:
sed s/PASS.*$/'PASS XXXXXXX'/ apologies example follows: [ppaprota@pettallc ~]$ Code:
echo "quote PASS hidemypass" | sed s/'quote PASS.*$'/'quote PASS XXXXXXX'/ quote PASS XXXXXXX [ppaprota@pettallc ~]$ Last edited by jim mcnamara; 11-19-2012 at 06:28 PM.. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Delete to eol after PASS with sed | ppaprota | How to Post in the The UNIX and Linux Forums | 1 | 11-19-2012 01:29 PM |
| Including EOL in egrep pattern for multiple lines | Anonym | Shell Programming and Scripting | 2 | 11-09-2012 10:45 AM |
| sed pattern to delete lines containing a pattern, except the first occurance | gary_w | Shell Programming and Scripting | 8 | 10-09-2011 06:47 PM |
| locate a pattern and delete it using sed | hobiwhenuknowme | UNIX for Dummies Questions & Answers | 2 | 08-10-2010 09:32 PM |
| sed delete pattern with special characters | stinkefisch | Shell Programming and Scripting | 5 | 09-13-2009 10:58 PM |
|
|