Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8995003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:33:08+00:00 2026-06-15T23:33:08+00:00

So, basically, what I want to do is execute this Bash script : #!/bin/bash

  • 0

So, basically, what I want to do is execute this Bash script :

#!/bin/bash

path="./"
filename="Ellly.blend"
file=${path}${filename}
description="Test of the api with a simple model"
token_api="ff00ff"
title="Uber Glasses"
tags="test collada glasses"
private=1
password="Tr0b4dor&3"

curl -k -X POST -F "fileModel=@${file}" -F "filenameModel=${filename}" -F "title=${title}" -F "description=${description}" -F "tags=${tags}" -F "private=${private}" -F "password=${password}" -F "token=${token_api}" https://api.sketchfab.com/v1/models

Inside a PHP function. Problem is, I don’t really see how I can pass to it some variables and then wait for it to end before resuming the PHP function.

Any help ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:33:10+00:00Added an answer on June 15, 2026 at 11:33 pm

    Note: I didn’t do all the settings, just enough I hope you get the idea.

    Option 1: Passing parameters

    PHP:

    $file = escapeshellarg($file);
    $filename = escapeshellarg($filename);
    // escape the others
    $output = exec("./bashscript $file $filename $tags $private $password");
    

    Bash:

    #!/bin/bash
    filename=$1
    file=$2
    description="Test of the api with a simple model"
    token_api="ff00ff"
    title="Uber Glasses"
    tags=$3
    private=$4
    password=$5
    
    ...
    

    Option 2: Using environment variables

    PHP:

    putenv("FILENAME=$filename");
    putenv("FILE=$file");
    putenv("TAGS=$tags");
    putenv("PRIVATE=$private");
    putenv("PASSWORD=$PASSWORD");
    
    $output = exec('./bash_script');
    

    Bash:

    filename=$FILENAME
    file=$FILE
    description="Test of the api with a simple model"
    token_api="ff00ff"
    title="Uber Glasses"
    tags=$TAGS
    private=$PRIVATE
    password=$PASSWORD
    
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been struggling with this problem when writing a bash script. Basically, I want
Well basically I may want to execute a script that may take as much
I want to execute a .sql script from C#. Basically the script inserts a
I basically want to do this in code: PersonList myPersonList; //populate myPersonList here, not
I am trying to execute a command in Node: cd /www/foo/ && /path/to/git/bin/git.exe config
I want do this: sender_email = @request.user.paypal_email if @request.user.paypal_email == paypal@anonymous.com So basically I
Any help on this problem will be greatly appreciated. So basically I want to
I have node installed on my server. I want to execute a JavaScript file
I basically have a bash script which executes 5 commands in a row. I
I basically want a dispatcher timer object to only execute once. So I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.