Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 11:18 on June 26, 2006


A simple shell problems

Why have I not done according to a book written? I was using the FreeBSD5.2.1
Assignment to a variable time
#$age=21
#echo Age
Age
#echo $age
Above shows age:Undifined Varible


But I have used this writing
#set Age=21
#echo $age
21
But a book that can be used in the first method, the second is, I guess, it really can, I do not know if I have a What Is Wrong? ?

A simple shell problems

@_!
Zhiding asked on the 13th to see how a variable assignment!

A simple shell problems

A : It is not the first age=21 $age=21
Echo echo age is not $age

A simple shell problems

However, Shell eyed age=21, shown below
Age=21:command not found

A simple shell problems

-->
I was sco :
As follows :
$ Age=21
$ Echo $age
21
$

A simple shell problems

-->
The bar is csh you should do :
Set age=21

A simple shell problems

Thank you, oh, I know! !

A simple shell problems

But the question is out there, I place it into fragments, according to a book written by two problems arise.
$ps1=a :
Now says
=a:not Found

Almost the first two issues
$echo "I want to study
"Unix"
Now says
I want to study
Unix : not found
Why is this? ? Version and is not related? ? I use the FreeBSD5.2

A simple shell problems

1, with capital!
PS1=
2, echo and "i. . . Have a blank space between!

A simple shell problems

Another problem : 1.
#SP1=a :
A :
Later, I reboot that it is not alright again with the following.
But using echo $SP1, it could be : a show! How will this happen?
There above the second question, can be achieved, but the following shows
I want to study
Unix
Is a branch, but it is in his book, not a branch operation is not my problem? ?
Thank you, bjgirl!

A simple shell problems

1, PS1=a : Add to your /etc/profile.
[code]export PS1=a[/code]
If you are using Linux, if it is for other document please find the corresponding allocation
2, as follows :
Echo "i want to study[color=red]\[/color]
Unix "

A simple shell problems

Issue out of the calculation of the background &;
# Date&;pwd&
[1] DONE date
[2] DONE pwd
The process is a book that shows the ID, [1], [2], the process ID, obviously not, why not? ?

A simple shell problems

No. process? Tasks (job) bars

A simple shell problems

But I say this is top foreign guidance, if they did it would arise in the process ID!
$date&; Pwd& ;ls-C&
2215
2217
2216
This is a book written!

A simple shell problems

[code]
$sleep 600&
[1] 782
[/code]
You order the end of operation, where the process ID!

A simple shell problems

600& on using your sleep, the order is indeed over, but it should have been in operation, you can find it is still in use ps order, then it should be the process ID is not?
ID & Order will be used in the show.
So when I when operating $sleep 600& anything, not even you say 782 [1] are not, why? ? Puzzling

A simple shell problems

I suggest you look bg, fg, jobs, ps, & etc. These orders on the use of process management : oops :
Ps:my Linux OS

A simple shell problems

I have been able to learn, from the start until now has not been equipped with a UNIX week, I also understand that I will be efforts to learn! ! Speed up, up, up. . . . . . . . . . Flying! :)



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com