BashでPHPファイルの内容を実行するときにいくつかのコマンドを実行できますか?

BashでPHPファイルの内容を実行するときにいくつかのコマンドを実行できますか?

誤ってこれを本番サーバーのスーパーユーザーとしてbashに貼り付けました。

今は爪を食べています。

私はすべての行を見ましたが、ほとんどの構文エラーが発生しました。しかし、サーバーオペレーティングシステムを損傷する可能性がある何か悪いことがありますか?それともファイル?または何をか。

Ubuntuサーバー14.04です。

どのコマンドが実行され、どのタスクが実行されたかをどのように診断しますか?

歴史は明らかな場所ですが、何が実行され、どのプログラムによって実行されたかは示していません。この愚かさを診断する方法はありますか?

<?php
/**
 * The base configurations of the WordPress.
 *
 * This file has the following configurations: MySQL settings, Table Prefix,
 * Secret Keys, WordPress Language, and ABSPATH. You can find more information
 * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
 * wp-config.php} Codex page. You can get the MySQL settings from your web host.
 *
 * This file is used by the wp-config.php creation script during the
 * installation. You don't have to use the web site, you can just copy this file
 * to "wp-config.php" and fill in the values.
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', '');

/** MySQL database username */
define('DB_USER', '');

/** MySQL database password */
define('DB_PASSWORD', '');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         'N%___i}IF<(o&h<;|_/0g-OYxEeU)Pq_JM@x!`S^-*[*$$#`|Lp|4R|');
define('SECURE_AUTH_KEY',  '.JyD{}94,kBQB`>&>)sT@4bMl|}SxJQ~ 1NUw^RdQ;QrLVC#].#64k');
define('LOGGED_IN_KEY',    '2ClY{7eA4933w3qEQ(L>o<{`WD|t-b4B<KW;psm6qa_Mmk.f~N1$]8');
define('NONCE_KEY',        ' $QAiTez.wIq_},tNekyQYgU3:;>y-[LT-vR8X{r+kuG-t!C>');
define('AUTH_SALT',        '!#0MnA@UTy]~CN#[Akn-2M<fEuGjSH,*Bu7B[!@@.owHb:G-_PXvP_');
define('SECURE_AUTH_SALT', '%DXWY0|+SkU%!aC.aXG#T{ |YZE|X.VyfVx8QW:bX+2sZ(7cw98i');
define('LOGGED_IN_SALT',   '{d}Pn%i>?B &Q@#Dw+*Xal^eD`xK4wet8=k+F9Tr2}2H75.@+{g+)');
define('NONCE_SALT',       ']3gOf&v-43GEe`hOqnu_1TwZeqU!ZIm-8}Lm1&0;pW7d`,4[QTT');

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each a unique
 * prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 */
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

ベストアンサー1

(隠されていない)ファイルを含むディレクトリでこれが起こると、で始まるすべての行がそのディレクトリの(隠されていない)ファイルのリストに展開されるため、最初のファイルはコマンド1*として実行されます。もしあれば実行を試みます。.PATHそのファイル;実行できない場合はエラーが発生します。あなたの名前.に存在しない場合は、そのPATH名前を使用してコマンドを実行しようとします。たとえば、現在のディレクトリに次のファイルが含まれている場合

rm
romeo
sierra
tango

だから

* The base configurations of the WordPress.

コマンドは次に展開されます。

rm romeo sierra tango The base configurations of the WordPress.

このようなことが起こっているのか、今まで気づいたことを願っています。ただし、echo *最初のファイルが有効なコマンドであることを確認するには、aを実行することをお勧めします。

で始まる行についても同様の懸念がありますが、/**これは次のように拡張できます/bin /dev /etc /home /lib …

bash: /bin: is a directory

table_prefix次の名前のシェル変数がある場合

$table_prefix  = 'wp_';

変数を展開して実行しようとします。定義されていない場合、上記table_prefixのコマンドはコマンドとして実行しようとします=(私が知っている限り、標準のUnixシステムにはそのようなコマンドはありません)。

私にとって、他の何も問題ではありません。


1   unbalancedなど、構文エラーを引き起こす他の項目が行にない場合)

おすすめ記事