$command_script = "create_first_file.sh $this->server_user_name $id_app index$type_ex_file";
ssh2_exec($connection, "echo pass | sudo -S /bin/bash /opt/scripts/$command_script")
#!/bin/bash
#Create file
mkdir /opt/jails/$1/home/$1/$2
chown $1:$1 /opt/jails/$1/home/$1/$2
touch /opt/jails/$1/home/$1/$2/$3
chown $1:$1 /opt/jails/$1/home/$1/$2/$3
<input id="id_app" name="id_app" value="<?= $data->id; ?>" hidden>
$command_script = "create_first_file.sh $this->server_user_name " .
trim($id_app) . " index$type_ex_file";
$data->id
). Кстати, точка с запятой там лишняя, достаточно: <?=$data->id?>
.$id_app
.