![]() |
|
|
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 |
| How do I perform double substitution in bash? | flee | Shell Programming and Scripting | 3 | 04-09-2009 05:51 PM |
| Variable substitution | Leo_NN | UNIX for Dummies Questions & Answers | 7 | 10-17-2008 12:24 PM |
| Sed variable substitution when variable constructed of a directory path | alrinno | Shell Programming and Scripting | 2 | 07-11-2008 03:24 PM |
| Bash: bad substitution problem...pls help! | xfouxs | UNIX for Dummies Questions & Answers | 1 | 11-23-2007 05:48 PM |
| Substitution in a variable | spragueg | UNIX for Advanced & Expert Users | 3 | 10-18-2001 10:14 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
/bin/bash - variable substitution.
Is it possible with a bash variable to perform multiple substitution strings to one variable?
I have this variable: echo $clock TIMEZONE="US/Central" What I would like to do with bash only it pull out just the "US" part of the variable.. which could be any number of countries. this is where I am at: echo ${clock:10} US/Central" echo ${clock:10#*/} bash: testing: 10#*/: syntax error: operand expected (error token is "/") echo ${clock#*/} Central" So, am I just missing something.. or can I only do one type of substition with a bash variable? thanks, Trey |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|