Can someone please help explain this command in linux?

I'm not farmilar with linux commands and dont know python at all
so when i try to run this command, it keeps giving me error $3: Ambiguous
can some one help explain what is this command does?
specially the "$" part

ls -l $2
./Python-2.5.1/python Python-2.5.1/ Python-2.5.1/standard.txt $1 > $3
mv $3 $2/$3
Who is Participating?
Lee W, MVPConnect With a Mentor Technology and Business Process AdvisorCommented:
$3 is a variable that is supposed to be a file name if I'm reading that correctly... but you're not defining the file name - unless you are when you type it in when you execute the script...
IkelcaAuthor Commented:
then what is $1 and $2?
TintinConnect With a Mentor Commented:
$1 is the first parameter passed to the script
$2 is the second parameter passed to the script
$3 is the third parameter passed to the script
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

SuperdaveConnect With a Mentor Commented:
The first parameter is something passed to the Python script.  Anybody's guess what it does with seeing the Python script.
The second parameter is a name of a directory that it will first show you a listing of, then add the output of the Python program to.
The third parameter is the name of the file that will contain the output of the Python script and be moved into the specified directory.

You would type the name of the command (the file that contains the commands you showed) followed by the three parameters.
Lee W, MVPConnect With a Mentor Technology and Business Process AdvisorCommented:
For example, if your script name is "myscript" then running this at a prompt:

myscript my script example

$1 = my
$2 = script
$3 = example
prerakshethConnect With a Mentor Commented:
This part of the program would be running by another shell script or by command line, requiring to pass parameters. $1, $2, $3 are the parameters passed to the program (this peice of program) in that order.

It looks from your program lines that
$1: A name of file which Python program is using to do something
$2: directory where the result should be stored
$3: name of the actual file where the result is stored

Is this a test program? The lines don't make much sense in terms of functionality - you could achieve the same in just one line as

./Python-2.5.1/python Python-2.5.1/ Python-2.5.1/standard.txt $1 > $3/$2

Did you find the commands in a shell script ? (text file)

Are you typing it line by line ?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.