farhansadik / echominal

This script a simple manager for termux. User can use is in a short way. This script is very helpful for beginners
GNU General Public License v3.0
5 stars 0 forks source link

search.sh #35

Closed squaredevops closed 3 years ago

squaredevops commented 3 years ago

error

~/.../dev_files/test $ sh search.sh

search % javascript

executing ver 1

executing condition

search.sh: 15: [[: not found
search.sh: 15: javascript: not found
sorry no javascript has been found
farhansadik commented 3 years ago

Mine one seems ok

$ ./search.sh

search % javascript

executing ver 1

executing condition

found file
farhansadik commented 3 years ago

@squaredevops go for manual

squaredevops commented 3 years ago

Manual Output

~/.../dev_files/test $ find search.sh -type f
search.sh
~/.../dev_files/test $ file=search.sh
~/.../dev_files/test $ find $file -type f
search.sh
~/.../dev_files/test $ if [[`find $file -type f` == $file ]]; then echo found; else failed; fi
[[search.sh: command not found
No command failed found, did you mean:
 Command faked in package fakeroot
 Command file in package file

Result

Failed!

farhansadik commented 3 years ago

In my working environment

Farhan Sadik@KB306-Gaming-PC MINGW64 ~/Desktop/Desktop/echominal-development/dev_files/test (development)
$ a=search.sh

Farhan Sadik@KB306-Gaming-PC MINGW64 ~/Desktop/Desktop/echominal-development/dev_files/test (development)
$ file="$(find $a -type f)"

Farhan Sadik@KB306-Gaming-PC MINGW64 ~/Desktop/Desktop/echominal-development/dev_files/test (development)
$ if [[ $file == $a ]]; then echo found; else echo failed; fi
found

Result

found!

squaredevops commented 3 years ago

Error Found!

~/.../dev_files/test $ a=search.sh
~/.../dev_files/test $ f=$(fine $a -type f)
No command fine found, did you mean:
 Command file in package file
 Command find in package findutils

Worked

~/.../dev_files/test $ if find $a -type f; then echo ok; else echo f; fi
search.sh
ok
squaredevops commented 3 years ago

new patch has the same issue

~/.../dev_files/test $ sh search.sh

search % search.sh

search.sh: 15: [[: not found
sorry no search.sh has been found

can you try bash

squaredevops commented 3 years ago

patch v6 report

~/.../dev_files/test $ bash search.bash

search % search.bash

found file
~/.../dev_files/test $ bash search.bash

search % javascript

found file
~/.../dev_files/test $

Result

Successful

farhansadik commented 3 years ago

Now I'm adding previous find method in bash again! let me know the result!

squaredevops commented 3 years ago

patch v7 report

~/.../dev_files/test $ ls
 dialog-scripts   get_ver.py       'how to download.txt'   play_music.bash   search.bash   sub_loop.bash    sub_loop3.bash   youtube-dl
 dialog.bash      get_ver_test.py   javascript             scripts.bash      search.sh     sub_loop2.bash   ver_input.bash
~/.../dev_files/test $ bash search.bash

search % youtube-dl

sorry no youtube-dl has been found
~/.../dev_files/test $ bash search.bash

search % scripts.bash

found file
~/.../dev_files/test $

result

no directory found at this time

farhansadik commented 3 years ago

We don't need directory at this time

squaredevops commented 3 years ago

yes it worked

squaredevops commented 3 years ago

play-music patch v5

~/.../dev_files/test $ bash play_music.bash

song list from /sdcard/MP3

song1.mp3
song2.mp3
song3.mp3

search % song3.mp3

Now Playing: song3.mp3

Result!

Successful!

farhansadik commented 3 years ago

Glad to hear that! Time to deploy!

Thanks @squaredevops