bash_aliases

alias cp="cp -p"

alias apty="apt -y"

nc () {
        nedit -server "$@" > /dev/null &
}
complete -A file -A directory nc

cpt () {
        #dir=${1%/*}    ; echo $dir
        file=${1%%.*}   #; echo $file
        ext=${1#*.}     #; echo $ext

        tofile=$file"_"$(date -r "$1" +%d%b%y_%H%M%S).$ext
        #echo $tofile
        cp -p $1 $tofile
}
complete -A file -A directory cpt

cp_grub () {
        cpt /boot/grub/grub.cfg
        mkdir /mnt/sda3
        mount /dev/sda3 /mnt/sda3
        cpt /mnt/sda3/boot/grub/grub.cfg
        sed -e 's/hd0/hd3/g' -e 's/ahci0/ahci3/g' -e 's/\/efi/\/EFI/' /boot/grub/grub.cfg > /mnt/sda3/boot/grub/grub.cfg
        umount /dev/sda3
        rmdir /mnt/sda3/
}

Nessun commento: