Check These Out
Replace 'csv_file.csv' with your filename.
Exclude 400 client hosts with NFS auto-mounted home directories.
Easily modified for inclusion in your scripts.
Replace 'csv_file.csv' with your filename.
Splits the file "my_file" every 500 lines. Will create files called xx01 xx02 and so on. You can change the prefix by using the -f option. Comes in handy for splitting logfiles for example. I am using it for feeding a logfile parser with smaller files instead of one big file (due to performance reasons)
Unlike other methods that use pipes and exec software like tr or sed or subshells, this is an extremely fast way to print a line and will always be able to detect the terminal width or else defaults to 80. It uses bash builtins for printf and echo and works with printf that supports the non-POSIX `-v` option to store result to var instead of printing to stdout.
Here it is in a function that lets you change the line character to use and the length with args, it also supports color escape sequences with the echo -e option.
$ function L() { local l=; builtin printf -vl "%${2:-${COLUMNS:-`tput cols 2>&-||echo 80`}}s\n" && echo -e "${l// /${1:-=}}"; }
With color:
$ L "`tput setaf 3`="
1. Use printf to store n space chars followed by a newline to an environment variable "l" where n is local environment variable from $COLUMNS if set, else it will use `tput cols` and if that fails it will default to 80.
2. If printf succeeds then echo `$l` that contains the chars, replacing all blank spaces with "-" (can be changed to anything you want).
From: http://www.askapache.com/linux/bash_profile-functions-advanced-shell.html http://www.askapache.com/linux/bash-power-prompt.html
For times when netcat isn't available.
Will throw a Connection refused message if a port is closed.
Scriptable:
$ (: /dev/null && echo "OPEN" || echo "CLOSED"
spectrum protect's dsmc command shows file names and total amount of restore.
This command shows which files are actually open and their siz in GB and highlights the change to the previous output
Changes standard mysql client output to 'less'.
In another words makes query results of mysql command line client to look much better.