Run PHP function inside Bash (and keep the return in a bash variable)

后端 未结 7 1943
故里飘歌
故里飘歌 2020-12-29 14:35

I am trying to run a PHP function inside Bash... but it is not working.

#! /bin/bash

/usr/bin/php << \'EOF\'

EOF
         


        
7条回答
  •  盖世英雄少女心
    2020-12-29 15:04

    I have a question - why don't you use functions to print current working directory in bash? Like:

    #!/bin/bash
    pwd # prints current working directory.
    

    Or

    #!/bin/bash
    variable=`pwd`
    echo $variable
    

    Edited: Code above changed to be working without problems.

提交回复
热议问题