This is a discussion on example for string connect to a command. within the Shell scripting forums, part of the Development/Scripting category; here is a example for str+str=command, ###script 1### str1='ls' str2='-l' str3="$str1 $str2" #notice the formular $str3 ###script 2### if debugout=true ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
here is a example for str+str=command,
###script 1### str1='ls' str2='-l' str3="$str1 $str2" #notice the formular $str3 ###script 2### if debugout=true ; then str1=' ' else str1='#' fi str2='echo this is debug output' str3="$str1 $str2" $str3 but actually, when str1=#, I got following err "# is not recognized" who have any idea ,pls share with me. THanks vivi[/quote] |
| Sponsored Links | ||
|
|
|
|||
|
I think you need something as follows:
Code:
debug="0" # 0 - true, nonzero = false str1='ls' str2='-l' str3="$str1 $str2" #notice the formular [ "$debug" == "0" ] && echo "$str1 $str2 $str3" || $str3 |
|
|||
|
right, it achieved what I want.
Quote:
|
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Not able to connect using remote desktop | aliment | CentOS / RHEL / Fedora | 0 | 04-14-2008 01:42 PM |
| fedora 7 connect dsl-502T | anthony pereira | Getting started tutorials | 4 | 12-22-2007 03:10 PM |
| split files by specifying a string (bash shell) | vikas027 | Shell scripting | 4 | 11-01-2007 05:22 PM |
| Connect mysql in c | raj | Databases servers | 1 | 08-10-2007 09:10 PM |
| linux command search server for string | chimu | Linux software | 2 | 07-26-2006 01:40 AM |