[BusyBox 0000697]: ash strstr command built-in

bugs at busybox.net bugs at busybox.net
Wed Feb 8 09:27:47 UTC 2006


A NOTE has been added to this issue. 
====================================================================== 
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:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             02-07-2006 07:58 PST
Last Modified:              02-08-2006 01:27 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. 

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                          
======================================================================




More information about the busybox-cvs mailing list