Using the ls command to hide non-executable files
The way to go :
for file in *; do test -x "$file" || echo "$file"; done
Thanks to not parsing ls
output
Linux/bash does not execute the executable that which tells me
Bash caches the location of commands. Use hash foo
to force it to update the cache.
Also, which
is a separate command that doesn't tell you where your shell is actually looking; it just consults the $PATH
environment variable. In bash, you should use type
instead:
$ type foo
foo is hashed (/a/foo)
Running executable file with additional options or arguments
I suggest you use
sh -c "$mp2 $myfile -m mymode"
instead of just
"$mp2 $myfile -m mymode"
Related Topics
Bash Script Counting Instances of Itself Wrongly
Bash Exit Script from Inside a Function
Sprof "Pltrel Not Found Error"
Statically Linked Shared Object? or a Corrupt File
Split and Rename The Splitted Files in Shell Script
Awk Command to Create Sha2 of Individual Column and Paste into New File
Ssl and Tkinter Not Present on Source Build of Python 3.5.2, Debian Linux
How Does/Frequent Unix Tee Command Write Stdout Terminal Output to File? If The Output Is Too Big
Is It Efficient to Use Epoll with Devices (/Dev/Event/...)
How to Modify The Linux Kernel to Change The Version String That Uname Returns
When to Use Linux Kernel Add_Timer Vs Queue_Delayed_Work
Some Flags About Workqueue in Kernel
Azure Cli Aks Install Cli Permission Denied and Sudo Does Not Work
Which Is Faster of Two Case or If