Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

what does $l means in a shell script

SOLVED
Go to Solution
Regular Advisor

what does $l means in a shell script

I wanted to know what does a $l (lower case L) means in a unix shell script?

Thanks

MSwift
5 REPLIES
Honored Contributor [Founder]

Re: what does $l means in a shell script

In what context?

A $l (lower case L) is probably just a variable of some sort. It has no special meaning to the shell.

If it is actually a $1 (the number 1), then that means the first argument on the from the execution of the script.

For example, if you execute:

# myscript.sh me too

Then $1=me and $2=too.

Honored Contributor [Founder]

Re: what does $l means in a shell script

Hello MSwift,

Most likely it is a shell variable (as , but it can depend from the context. With the dollar sign you can query the value of the variable like this:

# l=test
# echo $l
test
#

****
Unix operates with beer.
Honored Contributor [Founder]

Re: what does $l means in a shell script


Dear Mswift

when u execute a shell program, u can include parametes on the command line. when u do, each parameters must be separated with bland like.

scopy saj1 saj2 saj3

where scopy is a shell program with three parameters

when the shell program runs, u can access the value of these parameters with positional parameters $0,$1, $2 etc..

and $1 is equl to saj1
$2 is equal to saj2
$3 is eqaul to saj3

and $0 is always the command name
here it is scopy.

thanks and regards

Sajjad Sahir
Honored Contributor [Founder]

Re: what does $l means in a shell script

by adding '-x' and running your script you can see what it does, using this method you can find out what gets assigned to $l and when.

unless it would be $1 in which case it got explained already by the others.

if it is $1 i suggest you use another font for your terminal so to not make this mistake in the future.
Highlighted
Honored Contributor [Founder]

Re: what does $l means in a shell script

Hi,
>>I wanted to know what does a $l (lower case L) means in a unix shell script?

Its depending upon your script can you post your script then we can be able to tell the meaning of your $l.

how you can use this see this below example
l=10
echo $l
10

suraj