LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-02-2010, 11:54 AM   #1
hayah
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Rep: Reputation: -2
Help with an assignment: writing a bash script


Hi there

I really need help. I have assignment to write bash script and I have to submit it after tommorow . I do not have experience to finish it by myself.

I am really need help if any one can contact me. on my email I will be thanks him/ her.

I can alo pay for that help.

Regard
 
Old 10-02-2010, 12:02 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Hello there, and welcome to LQ!

This is totally not the way things are done on this help forum.

Members are encouraged to help each other in the forum environment, so that others too can learn from the solution to your problem.
This means showing us what you've got to work with (show us the code), and explaining what you're trying to accomplish, and what is not working or where you are having difficulty. Show us any error messages that your code produces. Tell us what operating system you're working on too, if it has any bearing on the problem.

Please bear in mind this is a public forum, not a private help service, so assistance comes on a volunteer basis, and whenever someone feels like trying to help, and has a few minutes to do so.

Kind regards.
 
Old 10-02-2010, 12:36 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by hayah View Post
Hi there
I really need help. I have assignment to write bash script and I have to submit it after tommorow . I do not have experience to finish it by myself.

I am really need help if any one can contact me. on my email I will be thanks him/ her.

I can alo pay for that help.
Regard
As GrapefruiTgirl said, we're not going to provide you with one-on-one, personalized support. To clarify, this is a HELP forum...that means, YOU do the work, and come here if you get stuck. When you do, post what you've written, and where you're having a problem. We will be glad to ASSIST you, but we're not going to do your homework for you.

If you can pay someone to write a script for you, you can probably pay for books and/or a tutor, to actually LEARN how to do it yourself.
 
Old 10-02-2010, 08:55 PM   #4
hayah
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Original Poster
Rep: Reputation: -2
Hi

Thanks for clear the rule for me.

I will try my best to understand the question and start my answers and ask you to help me

Thanks
 
Old 10-02-2010, 10:06 PM   #5
hayah
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Original Poster
Rep: Reputation: -2
So lets start,

I relaised that the gcc followed by the the programm name will compile the program and create excutable program from it. Then we $ ./example to run the executable filse.

My question if the programmer need to edit his program is there is any command open it to edit under the lunix or he just need to use any text editor ?

Thank

Last edited by hayah; 10-02-2010 at 10:19 PM.
 
Old 10-02-2010, 10:11 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by hayah View Post
My question if the programmer need to edit his program is there any code open it under the lunix or he just need to use any text editor ?
You can use any text editor you like.

Cheers,

Evo2.
 
Old 10-03-2010, 12:58 AM   #7
hayah
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Original Poster
Rep: Reputation: -2
Hi again,

Now as administrator I would solve the out of memory errors.

Is that problem can be solved by create a swap file by using dd comanad and extend its cpacity ??

Thanks
 
Old 10-03-2010, 01:11 AM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
Now as administrator I would solve the out of memory errors.
some guiding

step 1 NEVER NEVER log into the gui ( gnome,KDE,xfce) as root
-- research that and you will find out why --
if you are infront of the computer ( and NOT using ssh )
depending IF you have "sudo" set up ( some like it , i do not )
use , as a normal user, it the terminal
1) su -
2) su
3) sudo

all 3 can start a root session , BUT do different things

Linux dose not use the Microsoft "Administrator " account
It uses " root "

as to the "out of memory " ???? with out the full error and full code and command that are causing it , we can not help
-- our "Chrystal Balls" do not show anything --

In your first post it was about a bash script ( that is very different than a c or c++ program )
some reading on the basics might help
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.linux.org/lessons/

Quote:
s that problem can be solved by create a swap file by using dd comanad and extend its cpacity ??
?? most likely " maybe/maybe not" ??
you might want to read the dd man page
Code:
man dd

Last edited by John VV; 10-03-2010 at 01:13 AM.
 
Old 10-03-2010, 03:33 AM   #9
hayah
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Original Poster
Rep: Reputation: -2
hi dears,

Now I came with an interesting Q.

I want to write a bash script to automate the user creation. This script will prompts u to enter the following:
- Username
- Real name
- Office number
- Telephone
- Password
Then this information will be used to create the user.
So now,
How to begin the script?
In which format it will be?
How to run it for testing purpose?
How to let the script ask the user for the information?

Let's start dears 

Last edited by hayah; 10-03-2010 at 03:40 AM.
 
Old 10-03-2010, 03:58 AM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
The command useradd can do all this. Do you really want to reinvent the wheel?

If you are interested in shell scripting there are many resources on the web.

For example:
http://www.google.com/search?q=bash+script+tutorial

Cheers,

Evo2.
 
Old 10-03-2010, 05:28 AM   #11
hayah
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Original Poster
Rep: Reputation: -2
I have written the code but I could not try it because I do not have linux can I provide the code to check for me ?
 
Old 10-03-2010, 07:17 AM   #12
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by hayah View Post
I have written the code but I could not try it because I do not have linux can I provide the code to check for me ?
Yes
 
Old 10-03-2010, 07:31 AM   #13
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
@ hayah,

you say you do not have your own Linux to test this code? If so, then why not?

To better be able to learn and practice, you *really* should download a Linux OS, or install a VM on your Windows machine (or something!) and install Linux inside there, so you have a machine to practice on. And, if you do not want to do any actual installations to your machine, download a LiveCD to use instead; at least you'll have an environment where you can write your code and test it!

What if we tell you your code looks fine, but we overlook a bug? You won't really know if the code works or not, and if it doesn't, then it won't be working when you hand in your assignment!

EDIT - There may be a bash-like shell (or even bash itself) available for Windows too - I don't know for sure - but it'd be worth it to you to investigate.

Last edited by GrapefruiTgirl; 10-03-2010 at 07:33 AM.
 
Old 10-03-2010, 09:20 AM   #14
hayah
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Original Poster
Rep: Reputation: -2
Quote:
Originally Posted by GrapefruiTgirl View Post
@ hayah,

you say you do not have your own Linux to test this code? If so, then why not?

To better be able to learn and practice, you *really* should download a Linux OS, or install a VM on your Windows machine (or something!) and install Linux inside there, so you have a machine to practice on. And, if you do not want to do any actual installations to your machine, download a LiveCD to use instead; at least you'll have an environment where you can write your code and test it!

What if we tell you your code looks fine, but we overlook a bug? You won't really know if the code works or not, and if it doesn't, then it won't be working when you hand in your assignment!

EDIT - There may be a bash-like shell (or even bash itself) available for Windows too - I don't know for sure - but it'd be worth it to you to investigate.
Thanks dear for your advice actually I am not going to complete studying linux. I just want to finih this course and stop learning more about linux if you could help check the codes I will be thanks that.
 
Old 10-03-2010, 09:31 AM   #15
hayah
LQ Newbie
 
Registered: Oct 2010
Posts: 11

Original Poster
Rep: Reputation: -2
please find the code in tha attacment . and return to up to read the question please help me if there mistakes
Attached Files
File Type: txt adduser.sh.txt (451 Bytes, 24 views)
 
  


Reply



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
Need help writing a bash script stympman Linux - Newbie 2 10-18-2008 07:55 PM
Writing a bash script s_b Linux - Newbie 7 10-08-2008 12:32 PM
looking for help in writing a bash script onepostonly Linux - General 3 10-05-2008 06:42 PM
Help Me>> Need help in writing Bash script lamak_98 Programming 6 10-04-2007 10:44 AM
Bash (help writing script) lebabyg Linux - General 7 07-04-2006 05:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:16 PM.

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