Hello I would like to perform an alias to get an specific colum, parameter using a separator in order to achieve this i decided to use the cut command I created the alias as follows, and I saved it in the corresponding bashrc file:
alias getColumn='cat $1 | cut -d'$2' -f'$3''
However when I tested it I got:
VirtualBox:~$ getColumn /tmp/tmp.9Eusfk5cKZ , 3
cut: the delimiter must be a single character
Try 'cut --help' for more information.
SeVirtualBox:~$ getColumn /tmp/tmp.9Eusfk5cKZ "," "3"
cut: the delimiter must be a single character
Try 'cut --help' for more information.
cond try:
After feedback from here I tried:
#function to get a column
function getColumn() {
cut -d"$2" -f"$3" "$1"
}
However I got:
VirtualBox:~$ getColumn topics " " 2
cut: the delimiter must be a single character
Try 'cut --help' for more information.
I am using ubuntu for this proves,