Jump to content

Problema Script Linux: 2 Argumente


marculescumihai

Recommended Posts

Problema suna in felul urmator. Am de creat un script(script1.sh) ce va primi 2 argumente .( de exemplu scriptul va fi rulat cu  : ./script1.sh "string" "/path/to/the/second/script2.sh")

Scriptul trebuie sa seteaze o variabila locala VAR01 ce va avea valoarea egala cu valoarea primului argument primit.( conform exemplului VAR01 va avea valoare "string").

 

Al doilea argument reprezinta calea catre un alt script care va trebui lansat, in executie din
interiorul scriptului creat. Acest al doilea script ( ca carei adresa o primeste primul ca argument) trebuie rulat din interiorul sciptului cu un anumit argument ("array").
 
Intrebarea mea : Cum apelez un script din interiorul altuia folosindu-ma de adresa primita ca argument de script1.sh si cum ii pot atibuii acestui al doilea script( script2.sh) un argument.Mentionez ca pot crea/modifica doar PRIMUL script( script1.sh)
  • Upvote 2
  • Downvote 1
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.