Using ‘sed’ to find and replace
The few, the brave.
The few, the brave.
Which command will print the sizes of all files and directories in the tmp directory (including hidden ones) and sort them by sizes from
largest to smallest in human readable format (e.g. 2 GB)?
So I well understand that exit code of 0 is considered success in running of a program. Then we use this in bash scripts with logical AND and OR to run the next program based on the exit status of the first program. A good example can be found here: https://unix.stackexchange.com/a/187148/454362
My bash script:
Consider Source code: 1. Parent.sh #!/usr/bin/ksh # No tee ksh Child.sh; exit_status=$?; echo "Exit status: ${exit_status}" # Using tee ksh Child.sh | tee -a log.txt; exit_status=$?; echo "Exit status: ${exit_status}" 2. Child.sh #!/usr/bin/ksh … exit 1; Output: Exit status: 1 Exit status: 0 Variable $exit_status is capturing the exit status of Child.sh and so is … Read more
I have below inputs with huge number of rows
I am aware of three methods to delete all entries from a file.
Is it possible to copy the whole rows of File1 in a new File3 following the instruction given by File2 by using a simple bash script using sed or awk?
I’d like to know what the minus (-) and the EOC in the command below means. I know some languages like Perl allows you to chose any combination of character (not bound to EOF) but is that the case here? And the minus is a complete mystery for me. Thanks in advance!
I seem to misunderstand the Bash rule for creating a subshell. I thought parentheses always creates a subshell, which runs as its own process.