Do I need to quote command substitutions when assigning their output to a variable?
DIRNAME=”$(dirname $FILE)” will not do what you want if $FILE contains whitespace or globbing characters [?*.
DIRNAME=”$(dirname $FILE)” will not do what you want if $FILE contains whitespace or globbing characters [?*.
I want to be able to search for files over 14 days and over 10k and than rsync those found files to a destination.
Does the command pwd in a shell script output the directory the shell script is in?
The s command can be followed by zero or more of the following flags:
According to the answer to What are login and non-login shells? on Ask Ubuntu, GNOME Terminal is a type of non-login shell.
As pointed out in the excellent book, A Practical Guide to Fedora and Red Hat Enterprise Linux, 6th Edition:
I have a directory with ~1M files and need to search for particular patterns. I know how to do it for all the files:
Context for the question: According to POSIX specs, ARG_MAX is maximum length of command-line arguments to exec() family of functions. Which lead me to believe that’s actual number of arguments, however that clearly didn’t work: $ ulimit -s 8192 $ touch {1..18000}.jpg $ rm *.jpg $ Clearly, this works fine, despite being in length over … Read more
In my testing (in Bash and Z Shell), I saw no problems with defining functions or aliases or executable shell scripts which have hyphens in the name, but I’m not confident that this will be okay in all shells and in all use cases.
Interpreter directives allow scripts and data files to be used as
commands, hiding the details of their implementation from users and
other programs, by removing the need to prefix scripts with their
interpreter on the command line.
I just wanted to ask whether there is any command which would work on common shells (bash, dash, kornshell)? It is supposed to check if the line variable contains any part of the path.