Replaceable parameter
I am trying to use a replaceable parameter so I can just type
search.sh Blank.sh for example. I guess I am not using it correctly. Code:
find / -name $1 |
If the contents of search.sh contains the find statement $1 reflects the first parameter in the search call.
But I must say the information you provide is minimal. You don't post t he contents of you script file. You don't tell why you assume you don't use it correctly. If you want assistance you should show at least the effort to post correctly. If that is too much effort, why do you expect someone's else effort. jlinkels |
you need to try the command locate to find files on your host (instead of find)
|
Quote:
I am seeking help. |
#!/bin/bash
# Faster than P_Find # Find files using a replaceble parameter # ex. Find_File.sh Blank.sh # # Linux Puppy 5.9.3 # SiegeWorks 2014 A.P.K. # clear find / -name $1 |
For me it works and the file is shown as searched for. Where does it not for you? How do you call the script?
jlinkels |
I do not understand this statement.
Quote:
I put my script directory in my path, so all I do is Find_File <name of file> (No .sh extension is needed nor a ./ prefix ) Later I will improve the script by adding more parameters. |
I don't think anyone was being critical, but I agree that it is not at all clear what problem you are seeking help with.
Perhaps an example would help, if you could show us how you call the script and what the result is, and why you think it is not correct. For example... Code:
Find_File somefilename |
Quote:
Code:
jlinkels@donald-pc:/tmp$ ./find_file.sh saints_marching.wav Quote:
jlinkels |
Quote:
No not that : Code:
[dracula on client ~] $ cat testaprog.sh |
Quote:
There are many sripts on your system which have no extension. When the kernel sees !#/bin/bash/ then it knows that it is a script. |
Astrogeek,
I posted that my script is working. Maybe it is the lang uage difference ? |
Quote:
jlinkels |
Would you like me to post my console output ? :-)
|
Quote:
So, if it is working, do you have a question or were you only sharing your script? Quote:
|
All times are GMT -5. The time now is 05:47 AM. |