LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-03-2017, 06:05 PM   #1
barakolshe
LQ Newbie
 
Registered: Jun 2017
Posts: 7

Rep: Reputation: Disabled
Passing string argument to script


Hello, I've been trying to make a script called bandit20-do to run.
First I ran it without arguments(./bandit20-do) and the script returned:
Run a command as another user.
Example: ./bandit20-do id

Afterwards I understood that I need to pass an argument into the script, but I don't understand how.
So far I've tried various ways (and I entered id 11020):
./bandit20-do 11020
./bandit20-do "11020"
./bandit20-do '11020'

None of these worked so far, can anyone please help me?
 
Old 07-03-2017, 06:11 PM   #2
barakolshe
LQ Newbie
 
Registered: Jun 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
solved

It was my bad actually, the script is just running commands and I should have given him a command instead of an id.
 
  


Reply

Tags
argument, script


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
passing multiple argument to expect script sumeet inani Linux - Newbie 11 05-06-2014 08:12 AM
Syntax for passing argument in shell script shridhar22 Programming 11 08-30-2012 04:42 PM
Passing string as a single argument in shell script sinoob Linux - General 3 09-14-2011 03:21 AM
[SOLVED] (Something like...) passing an argument to a MATLAB script Mike_V Programming 1 12-21-2009 04:04 PM
shell script, Passing string as argument? antis Programming 4 09-07-2007 01:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration