|
|||||||
| 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
|
|||
|
|||
|
sed command
Hi All , could you please let me know hoe the following command is working!!! Code:
sed 's[^./[[g' Thanks Preetpal Last edited by Franklin52; 05-24-2012 at 03:28 AM.. Reason: Please use code tags |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Hi Used to remove ./ from the beginning of a variable: Code:
$ echo ./abc/efg/hij ./abc/efg/hij sed: Code:
$ echo ./abc/efg/hij | sed 's[^./[[g' abc/efg/hij |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Quote:
It'd actually remove any character followed by "/" at the beginning. e.g. Code:
$ echo //abc/efg/hij | sed 's|^./||g' abc/efg/hij $ echo a/abc/efg/hij | sed 's|^./||g' abc/efg/hij To remove "./" you must escape the ".". Code:
echo ./abc/efg/hij | sed 's[^\./[[g' You could use any other symbol instead of "[" if it looks weird. Code:
echo ./abc/efg/hij | sed 's|^./||g' |
| 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 |
| passing command output from one command to the next command in cshell | kaaliakahn | UNIX for Dummies Questions & Answers | 2 | 02-10-2012 04:59 PM |
| unix command : how to insert text at the cursor location via command line? | xib.be | UNIX for Advanced & Expert Users | 0 | 12-22-2010 05:45 PM |
| Need help! command working ok when executed in command line, but fails when run inside a script! | 4dirk1 | Shell Programming and Scripting | 4 | 12-02-2010 05:47 AM |
| awk/sed Command : Parse parameter file / send the lines to the ksh export command | rajan_san | Shell Programming and Scripting | 4 | 11-06-2008 12:29 PM |
| assign a command line argument and a unix command to awk variables | sweta_doshi | Shell Programming and Scripting | 0 | 08-08-2008 06:54 AM |
|
|