[BusyBox 0000697]: ash strstr command built-in

bugs at busybox.net bugs at busybox.net
Wed Feb 8 14:21:01 UTC 2006


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=697 
====================================================================== 
Reported By:                nawawi
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   697
Category:                   New Features
Reproducibility:            always
Severity:                   feature
Priority:                   none
Status:                     closed
Resolution:                 no change required
Fixed in Version:           
====================================================================== 
Date Submitted:             02-07-2006 07:58 PST
Last Modified:              02-08-2006 06:21 PST
====================================================================== 
Summary:                    ash strstr command built-in
Description: 
add c-syntax strstr feature to ash shell.
if success return 1 else return 0.

example:

if strstr "i like cat" "cat"; then
  echo "found cat"
fi

strstr "i like cat" "cat"
if [ $? = 1 ]; then
 echo "found cat"
fi
====================================================================== 

---------------------------------------------------------------------- 
 vodz - 02-07-06 08:05  
---------------------------------------------------------------------- 
My bash have not this builtins command.
Also. You really sure use putchar('0') vs printf("0\n")? 

---------------------------------------------------------------------- 
 nawawi - 02-07-06 22:49  
---------------------------------------------------------------------- 
i've fixed it only return value

if success return 0 else return 1.
eg;

if strstr "this is test" "test" ;then
  echo "found - return $?"
fi

if strstr "this is test" "testss" ;then
        echo "found - return $?"
else
  echo "not found - return $?"

fi 

---------------------------------------------------------------------- 
 vodz - 02-08-06 01:27  
---------------------------------------------------------------------- 
>> My bash have not this builtins command.

>this function use for busybox ash shell you can test with busybox ash
enabled

;-)

I wished to tell, that it would be strange to add an featute to ash 
which is absent in more greater and bloated shell: bash. 

---------------------------------------------------------------------- 
 nawawi - 02-08-06 05:20  
---------------------------------------------------------------------- 
:) its ok.. im just plan to put some simple function to ash for string
manipulation.. like strstr,strtok, that not much effect to size. 

---------------------------------------------------------------------- 
 vodz - 02-08-06 06:21  
---------------------------------------------------------------------- 
Ok? Ok! Closed. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-07-06 07:58  nawawi         New Issue                                    
02-07-06 07:58  nawawi         Status                   new => assigned     
02-07-06 07:58  nawawi         Assigned To               => BusyBox         
02-07-06 07:58  nawawi         File Added: ash.c.patch                      
02-07-06 08:05  vodz           Note Added: 0001059                          
02-07-06 10:16  nawawi         Note Added: 0001060                          
02-07-06 22:18  nawawi         Note Deleted: 0001060                        
02-07-06 22:38  nawawi         File Added: ash.c-2.patch                    
02-07-06 22:49  nawawi         Note Added: 0001063                          
02-08-06 01:27  vodz           Note Added: 0001064                          
02-08-06 05:20  nawawi         Note Added: 0001065                          
02-08-06 06:21  vodz           Note Added: 0001066                          
02-08-06 06:21  vodz           Priority                 normal => none      
02-08-06 06:21  vodz           Status                   assigned => closed  
02-08-06 06:21  vodz           Resolution               open => no change
required
======================================================================




More information about the busybox-cvs mailing list