I assume that you are using gnome-terminal, and that the "custom command" you mention is the custom command which gnome-terminal will run instead of the default shell (usually bash).
Gnome-terminal is a terminal emulator. It has no knowledge of the concept of variables or variable expansion. That is why, if told to execute some string containing $PROJECT
, it will do just that, it will not expand $PROJECT
. Variable expansion is the work of the shell.
Read the wikipedia articles about terminal and shell to better understand the difference between a terminal and a shell.
If I am correct with my assumption, that you are running gnome-terminal with a custom command, then you should use this custom command instead:
bash -c "tail -3000f /home/user1/folder/$PROJECT/folder2/folder3/text.log"
This will tell gnome-terminal to execute bash with some arguments. The arguments will tell bash to execute the command tail
with some arguments. Only this time, before executing tail
, bash will expand the variable $PROJECT
before executing.
Note that starting bash using the parameter -c
will cause bash to not read the initialisation files (.bashrc
and/or .profile
). If $PROJECT
is defined in one of those files then the above command might fail because $PROJECT
will expand to nothing.
You can force bash to read the initialisation files by using the -l
parameter:
bash -l -c "tail -3000f /home/user1/folder/$PROJECT/folder2/folder3/text.log"
Note that bash has this concept of "login shell" and "interactive shell" with some implications on what initialisation files are read. For more explanation of the difference read the following question and answers: Difference between .bashrc and .bash_profile.