LinuxQuestions.org
Visit Jeremy's Blog.
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 02-23-2011, 07:00 AM   #1
Kielo
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Rep: Reputation: 0
Smile A few linux questions...


Hi all, new to the forums...

Currently doing some study for my exams, which is an exam on linux / shell scripts where I have multiple choice questions. A few of the questions are catching me out, and I can't find answers in the notes for them. I have been playing around in Fedora 12 with the commands but I'm not getting anything definitive for a few of them.... So hopefully someone can help here...


1. Which refers to the process ID number of the shell you are currently using:
a) $pid
b) $!
c) $id
d) $$

I think this one is $$, but when I login as root user on fedora, and try it... it says the command is not found, and the rest of the commands return nothing....

2. Which of the following will send a hangup signal to process 20692:
a) kill -l 20692
b) kill -9 20692
c) kill -19 20692
d) kill -20 20692

This one confuses me, I don't think it's (a) because kill -l is used to return a list of all the signals, and as for the rest of them... I tried them in fedora and each one returns the same message... so what's the deal with the numbers there, can anyone explain their significance?

3. What command can be used to load a function into memory?
a) source
b) function
c) memf
d) fmem

I have googled each of these commands, none make sense to me. I have also tried to find out about them in fedora, and memf and fmem seem to be fake commands, but I have no clear idea on what the other 2 do...




Thanks for reading,

Kielo
 
Old 02-23-2011, 07:12 AM   #2
Kielo
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Original Poster
Rep: Reputation: 0
1. Which refers to the process ID number of the shell you are currently using:
a) $pid
b) $!
c) $id
d) $$


This one is definitely D) $$

I didn't use an echo command so it wasn't returning values... Noob mistakes I guess!

Still puzzled on the rest....
 
Old 02-23-2011, 07:21 AM   #3
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,674
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Hitting Google with the keywords: gnu bash beginners would give you interesting results!

...
Quote:
Originally Posted by Kielo View Post
2. Which of the following will send a hangup signal to process 20692:
a) kill -l 20692
b) kill -9 20692
c) kill -19 20692
d) kill -20 20692

This one confuses me, I don't think it's (a) because kill -l is used to return a list of all the signals, and as for the rest of them... I tried them in fedora and each one returns the same message... so what's the deal with the numbers there, can anyone explain their significance?
I guess there is a typo in the first option (that should read 1 not l)
and its better to search Google by keywords: gnu signal handling rather than guessing things without knowing the concepts.

Quote:
Originally Posted by Kielo View Post
3. What command can be used to load a function into memory?
a) source
b) function
c) memf
d) fmem
These seem to be either Distro specific commands or junk. Well only the
source command has a man page in Suse!
and http://linux.die.net/man/ is a good site to look for man pages.

Last edited by TheIndependentAquarius; 02-23-2011 at 07:25 AM.
 
Old 02-23-2011, 07:23 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by Anisha Kaul View Post
I guess there is a typo in the first option (that should read 1 not l)
No, the 'l' for list is fine:

$ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
16) SIGSTKFLT 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ
26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR
31) SIGSYS 34) SIGRTMIN 35) SIGRTMIN+1 36) SIGRTMIN+2 37) SIGRTMIN+3
38) SIGRTMIN+4 39) SIGRTMIN+5 40) SIGRTMIN+6 41) SIGRTMIN+7 42) SIGRTMIN+8
43) SIGRTMIN+9 44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9 56) SIGRTMAX-8 57) SIGRTMAX-7
58) SIGRTMAX-6 59) SIGRTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-2
63) SIGRTMAX-1 64) SIGRTMAX
 
Old 02-23-2011, 07:29 AM   #5
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,674
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Quote:
Originally Posted by Nylex View Post
No, the 'l' for list is fine:

$ kill -l
1) SIGHUP
SIGHUP (numbered 1) is the signal for hanging (question is regarding hanging) says http://www.comptechdoc.org/os/linux/...pgsignals.html so...
 
Old 02-23-2011, 07:38 AM   #6
Kielo
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Ah -1... maybe it's time for me to get glasses, I must of read it wrong!

Thanks for the advice I'll google those and see how I get on.
 
Old 02-23-2011, 11:37 AM   #7
Stephen Morgan
Member
 
Registered: Feb 2011
Location: England
Distribution: Slackware
Posts: 163

Rep: Reputation: 17
function doesn't have a man page because it isn't a programme, it's a bash internal command.
 
  


Reply


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
[SOLVED] Questions and answer on Linux/Fedora and Red Hat Enterprise Linux, 5th Ed. msbernice Linux - Newbie 7 07-21-2010 07:51 AM


All times are GMT -5. The time now is 03:46 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration