I'm pretty new to linux, bash and so on. I have 2 problems(at the moment ...)both should be easy to solve.
All the code examples are .sh files and are called from the terminal with the sh file.sh command
First thing, why can i add the first string and not the second? it seems to me like the same operation...
DIR=$HOME/dir
DIR2=$DIR/test.php
echo $DIR
echo $DIR2
gives me this output:
/home/vm/dir
/test.phpdir
Second problem. I want to call the php-interpreter from an bash script.
#/home/vm/proj/test.php
<?php
echo __DIR__;
#home/vm/proj/script/script.sh
#! /bin/bash
PATH=$PATH:/$HOME/proj
php -f test.php
But this gives me always an error: couldnt find file...
So please help a noob and tell me hot to fix my code...
I can imageine that both of my problems are pretty simple to fix.
Thanks
EDIT:
System: Virtual Machine: Ubuntu 14.04.3 LTS, Trusty Tahr
Bash-version: 4.3.11(1)-release (x86_64-pc-linux-gnu)