How to print the remainder of a line using awk

#How to print remainder of line using awk

eliminate the first X columns…

Here is your challenge you have a list of cronjobs and you want to just execute the scheduled backup command with its arguments for a test run.

Using one command line, how would you do it?

Here is a sample root cronjob and I want to run the first entry with its arguments as a test run:

# m h  dom mon dow   command
 0 16  *   *   * /data/share/home/geoffm/dev/utils/ -i /usr/local/etc/include.lst -e /usr/local/etc/exclude.lst -t /data/bak/`hostname` -s 7 >/dev/null 2>&1
  5 0  *   *   * /data/share/motion/ >/dev/null 2>&1
*/15 *  *   *   * /data/share/home/geoffm/ >/dev/null 2>&1
####### below are WIP or OLD ########
# 16 6  *   *   * /usr/sbin/lynis -c --auditor "automated" --cronjob --quiet >/dev/null 2>&1
#*/5 *  *   *   * /usr/local/bin/ -f /usr/local/etc/watch-proc.conf -n geoffm@localhost >/dev/null 2>&1
#*/5 * * * * /data/share/home/geoffm/ "ping -c2" "ssh reboot" >/dev/null
#  7 * * * /usr/local/sbin/ &> /dev/null

Author image Geoff McNamara on #awk,

Centering a string

Center a string using awk

awk = everyone’s favorite - right?

People who know me also know that I prefer simple universally available tools to get a job done. Awk is probably one of my favorites because it does pretty much anything I need for quick and simple jobs. It is far more powerful than most people realize including associative arrays and it will do anything grep and sed
can do.

Recently I had the need to center a string of text. This is a easy problem that pretty much any freshman programmer can accomplish in a heartbeat but I decided to do it with awk. This sample gives you a chance to explore rudimentary features of awk.


Author image Geoff McNamara on #awk,