FireStats error : Database error: INSERT command denied to user 'dbo244183939'@'74.208.16.197' for table 'wp_firestats_pending_data'

MySQL Version: 5.0.81-log
SQL Query:
INSERT DELAYED INTO `wp_firestats_pending_data` ( `timestamp`, `site_id` , `url` , `referrer` , `useragent` , `ip`, `type` ) VALUES ( NOW(), '1', 'http://www.pinoytux.com/linux/tip-how-to-place-pause-in-bash-scripts', '', 'CCBot/1.0 (+http://www.commoncrawl.org/bot.html)', '38.107.191.89', NULL )
Dec
28

Tip: How to Place Pause in Bash Scripts

Author Rai    Category Linux     Tags , , , , ,

There some scripts that need human interaction from time to time from confirming certain actions or to warn users that they are about to do something stupid ( “ rm -rf / “, perhaps?). In any case, putting a pause break in a Bash script is a very nifty trick to learn.

This is an example of how to use the Bash built-in command read to put pauses in scripts:

#!/bin/bash

find /home -type f -name "*.txt"
read -p "Press [enter] key to delete *.txt files in /home or CTRL+C to exit"
find /home -type f -name "*.txt" | xargs rm -v

This example script will run the find command and display the results. If user presses the Enter key, the script will remove all files that were found, while pressing CTRL+C will terminate the script.

Here is another variation of the the script:

#!/bin/bash

find /home -type f -name "*.txt"
echo "Press [enter] key to delete *.txt files in /home or CTRL+C to exit"
read contscr
find /home -type f -name "*.txt" | xargs rm -v

Related Posts

Post comment

CommentLuv Enabled