cp: missing destination file operand after

Variable assignments in bash scripts require no space between the variable name and value or (unless quoted) within the value. Since a space was present in the line FILEBACKUPLOCATION= /../…/FMonday, it attempted to execute /../…/FMonday as a command (which caused the first error) with FILEBACKUPLOCATION assigned to an empty string. The variable was then not assigned when the other command … Read more

OSError – Errno 13 Permission denied

You need to change the directory permission so that web server process can change the directory. To change ownership of the directory, use chown:chown -R user-id:group-id /path/to/the/directory To see which user own the web server process (change httpd accordingly):ps aux | grep httpd | grep -v grep ORps -efl | grep httpd | grep -v grep

Shell script “for” loop syntax

Brace expansion, {x..y} is performed before other expansions, so you cannot use that for variable length sequences. Instead, use the seq 2 $max method as user mob stated. So, for your example it would be:

wait(null) and wait(&status) C language and Status

If you call wait(NULL) (wait(2)), you only wait for any child to terminate. With wait(&status) you wait for a child to terminate but you want to know some information about it’s termination. You can know if the child terminate normally with WIFEXITED(status) for example. status contains information about processes that you can check with some already defined MACRO.

Extract file basename without path and extension in bash

You don’t have to call the external basename command. Instead, you could use the following commands: Note that this solution should work in all recent (post 2004) POSIX compliant shells, (e.g. bash, dash, ksh, etc.). Source: Shell Command Language 2.6.2 Parameter Expansion More on bash String Manipulations: http://tldp.org/LDP/LG/issue18/bash.html