Help With bash script
Hi all,
I'm trying to find a tool or simple bash expression that will allow me to subtract a string from another string, or an expression from a string. for example. Say i have a string, Code:
"/home/user/code/src Code:
"/home/user/code/src/com/domain/pkg/blah.java" thanks |
Code:
string="/home/user/code/src/com/domain/pkg/blah.java" http://tldp.org/LDP/abs/html/string-manipulation.html |
I like using sed to do things like this. Here's my way:
Code:
[twantrd@twantrd /]$ echo "/home/user/code/src/com/domain/pkg/blah.java" | sed 's#\(.*src/\)\(.*\)#\2#' -twantrd |
Thank you!!
Both options worked fine. I ended up just going with bash. Also thanks for the link had a lot of good stuff i was looking for. |
Why not using this..?
elio@darkstar:~$ echo /home/user/code/src/com/domain/pkg/blah.java | cut -d / -f 6,7,8,9 com/domain/pkg/blah.java Ciao |
All times are GMT -5. The time now is 04:59 AM. |