![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bash Shell to sh Shell In a Script | saurabh84g | Shell Programming and Scripting | 8 | 08-29-2008 06:51 AM |
| different shell csh bash | ajp7701 | Shell Programming and Scripting | 1 | 04-18-2008 05:19 PM |
| c shell instead of bash | ajp7701 | Shell Programming and Scripting | 0 | 03-18-2008 04:15 PM |
| Bash Shell | BG_JrAdmin | Linux | 1 | 08-07-2006 02:56 PM |
| Bash shell ... | VijayHegde | Shell Programming and Scripting | 2 | 06-06-2006 09:09 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
bash shell piping
Hello all,
I am new to bash. I am trying to get a sub string of a variable in a shell script. While trying to do that I get the following error: ------------------------------------------------------------------------ OHOME: /aaa/bbb/product/eee ./t.sh: line 6: /aaa/bbb/product/eee: No such file or directory Oracle Base: ------------------------------------------------------------------------ Here is the code: ------------------------------------------------------------------------ #!/bin/sh OHOME=/aaa/bbb/product/eee echo " OHOME: "$OHOME O_BASE=echo $OHOME | awk -F"/" '{for(i=2;i<=NF;i++) {if($i=="product"){exit;} a=a"/"$i; }} ' echo " Oracle Base: "$O_BASE ------------------------------------------------------------------------ I am very surprised. Since it does not seem to like "echo $OHOME" I tried several things like enclosing in brackets, single/double quotes, etc. I still get this error. I cannot seem to find the syntax from the book or google ![]() Looks very simple, but I am stuck on this for hours. Maybe experts here can guide me. Here is our Linux version: Linux <name> 2.6.9-67.0.20.ELsmp #1 SMP Wed Jun 18 12:40:47 EDT 2008 i686 i686 i386 GNU/Linux Rocky. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|