Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 12:27

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Bash Command in PHP

Discussion on Bash Command in PHP within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
MaLLaH95's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 106
Received Thanks: 16
Bash Command in PHP

Hallo,

ich habe eine Frage bezüglich eines Bash Scriptes, ich will diesen in PHP ausführen aber PHP zeigt fehler an und ich glaube es liegt an den ` zeichen

Quote:
$test = " echo "the middle is `echo $a | du -sh -s -m /home/nvme/user1/SERVER_6 | awk '{ print $1}'`" ";
MaLLaH95 is offline  
Old 07/21/2022, 19:06   #2


 
False's Avatar
 
elite*gold: 0
The Black Market: 243/0/0
Join Date: Apr 2011
Posts: 11,115
Received Thanks: 2,436
Du musst die zusätzliche Anführungszeichen escapen.
PHP Code:
$test "echo \"the middle is `echo $a | du -sh -s -m /home/nvme/user1/SERVER_6 | awk '{ print $1}'`\""
False is offline  
Old 07/30/2022, 23:18   #3
 
elite*gold: 11
Join Date: Nov 2010
Posts: 1,709
Received Thanks: 3,828
Code:
$test = ' echo "the middle is `echo $a | du -sh -s -m /home/nvme/user1/SERVER_6 | awk '"'"'{ print $1}'"'"'`" ';
{} are special characters when used inside double quotes, and they cannot be escaped
.Shōgun is offline  
Old 07/30/2022, 23:40   #4


 
False's Avatar
 
elite*gold: 0
The Black Market: 243/0/0
Join Date: Apr 2011
Posts: 11,115
Received Thanks: 2,436
Quote:
Originally Posted by .Shōgun View Post
Code:
$test = ' echo "the middle is `echo $a | du -sh -s -m /home/nvme/user1/SERVER_6 | awk '"'"'{ print $1}'"'"'`" ';
{} are special characters when used inside double quotes, and they cannot be escaped
Nobody talked about the {} chars, in this context you don't event have to escape them..
False is offline  
Reply


Similar Threads Similar Threads
Bash Error: Segmentation Fault At Use Space Into Command
06/20/2013 - General Coding - 0 Replies
Code (Doesn't work): #!/bin/sh ## Local de trabalho: /var/scripts/ ## ################################## ## Confs. ## DEVICE="SMARTPLUG" SV="TOGGLE_REQUEST" DELAY="3"
Command line interface working command
08/05/2012 - DarkOrbit - 27 Replies
I found only one working command: Enter "J" when you are in teleport Anyone know other commands?



All times are GMT +1. The time now is 12:27.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.