LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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


Closed Thread
  Search this Thread
Old 11-21-2011, 11:56 AM   #16
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78

you can start script with one of these (if your system has them). which one will you choose?
#!/bin/sh
or
#!/bin/bash
or
#!/bin/csh
or
#!/bin/ksh

after that you'll need to formulate some logical blocks by which you then write the code for. so maybe something like this:

[does src folder exist]
[ls of files in src dir]
[does dst folder exist]
[copy files to dst folder]
[handle exceptions accordingly]

for the other parts you'll need more logic blocks. gzip'ing should be rather easy. menu'ing should be rather easy. geez, many of those questions already say what to do.

please post when you are done, we would like to see what you came up with.

Last edited by Linux_Kidd; 11-21-2011 at 11:57 AM.
 
1 members found this post helpful.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-21-2011, 01:30 PM   #17
SigTerm
Member
 
Registered: Dec 2009
Distribution: Slackware 12.2
Posts: 379

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by engrmilad View Post
and if you checked what I have wrote
I checked your assignment, there's plenty of info to get started.

Quote:
Originally Posted by engrmilad View Post
if you were lucky with however taught
Nobody taught me, there's plenty of documentation for linux to learn without a teacher. Open the terminal, type "info bash" and start reading.

Quote:
Originally Posted by engrmilad View Post
just simply shut up and dont help..
Look, if you want "help", start asking proper question. I.e. "how I do this" or "what could I use to do that" instead of "please do my homework for me". Asking to do your homework is "no go". As I said, if you don't want to do your own homework, then head for any freelancing resource, and either pay somebody to do it for you or pay somebody to tutor you. The tutor might be a better idea, since if somebody simply does your homework instead of you, you won't avoid trouble later.
 
1 members found this post helpful.
Old 11-21-2011, 05:56 PM   #18
engrmilad
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jlinkels View Post
Perhaps your teacher is bad like this because during his education he also had his homework assignments made by others?

jlinkels
before you talk go check what i wrote, I bought all CBT Nuggets videos trying to get something and I will soon or later and if no one of yous believes what am saying, who cares!! I will do it for myself later .. anyways its easy guys (it's my fault) asking a help from you.. because there is no difference between yous and our teacher.. thanx genius jlinkels..


alright guys thank you indeed, my only concern was to pass my subject next week because I felt hopeless of trying and please for all those who say "show us what you tried" the problem is I have what I tried saved on a teacher's software called putty and cant have it with me so don't just come here and just find a subject to show yourselves that you are the best. I only came to this place when i felt hopeless and cant do nothing about it now coz no enough time for learning every thing now, this is my first time ever in my life asking someones help as well, anyways fuck this I dont want any help anymore.. DO NOT worry about it please...

I will watch the videos that I spent money on and learn this later in my life, and If the whole class is not getting anything right for now, then we will all pass somehow anyways..!!!

I am not really interested in reading any more ridiculous comments, because I know myself when I learn this right I bet you I will beat asses. so just simply ignore this fucking post OK??? and if there is any way to remove this post please let me know so I can remove it.....
 
0 members found this post helpful.
Old 11-21-2011, 06:00 PM   #19
engrmilad
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Linux_Kidd View Post
you can start script with one of these (if your system has them). which one will you choose?
#!/bin/sh
or
#!/bin/bash
or
#!/bin/csh
or
#!/bin/ksh

after that you'll need to formulate some logical blocks by which you then write the code for. so maybe something like this:

[does src folder exist]
[ls of files in src dir]
[does dst folder exist]
[copy files to dst folder]
[handle exceptions accordingly]

for the other parts you'll need more logic blocks. gzip'ing should be rather easy. menu'ing should be rather easy. geez, many of those questions already say what to do.

please post when you are done, we would like to see what you came up with.

Brother I appreciate your help for me.. thank you very much you are the best..
 
Old 11-21-2011, 06:07 PM   #20
Juako
Member
 
Registered: Mar 2010
Posts: 202

Rep: Reputation: 84
Quote:
Originally Posted by engrmilad View Post
before you talk go check what i wrote, I bought all CBT Nuggets videos trying to get something and I will soon or later and if no one of yous believes what am saying, who cares!! I will do it for myself later .. anyways its easy guys (it's my fault) asking a help from you.. because there is no difference between yous and our teacher.. thanx genius jlinkels..

alright guys thank you indeed, my only concern was to pass my subject next week because I felt hopeless of trying and please for all those who say "show us what you tried" the problem is I have what I tried saved on a teacher's software called putty and cant have it with me so don't just come here and just find a subject to show yourselves that you are the best. I only came to this place when i felt hopeless and cant do nothing about it now coz no enough time for learning every thing now, this is my first time ever in my life asking someones help as well, anyways fuck this I dont want any help anymore.. DO NOT worry about it please...

I will watch the videos that I spent money on and learn this later in my life, and If the whole class is not getting anything right for now, then we will all pass somehow anyways..!!!

I am not really interested in reading any more ridiculous comments, because I know myself when I learn this right I bet you I will beat asses. so just simply ignore this fucking post OK??? and if there is any way to remove this post please let me know so I can remove it.....
It's not buying videos how you learn...it's mainly reading docs, practicing, and asking politely, without calling peoples names (which you again did).

If you aren't interested in reading ridiculous comments just don't read them. Nobody is worrying about anything, but one thing I have to wonder: why post in the first place if you want the post to be removed? Doesn't make sense.

If you want to post your doubts instead of your rants about how the world won't work to your personal wish, here we are to help you.
 
Old 11-21-2011, 06:11 PM   #21
engrmilad
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Juako View Post
It's not buying videos how you learn...it's mainly reading docs, practicing, and asking politely, without calling peoples names (which you again did).

If you aren't interested in reading ridiculous comments just don't read them. Nobody is worrying about anything, but one thing I have to wonder: why post in the first place if you want the post to be removed? Doesn't make sense.

If you want to post your doubts instead of your rants about how the world won't work to your personal wish, here we are to help you.
well then just dont read my posts then and fuck up
 
0 members found this post helpful.
Old 11-21-2011, 06:31 PM   #22
Juako
Member
 
Registered: Mar 2010
Posts: 202

Rep: Reputation: 84
Your wishes are orders to me, sir! I won't read your posts anymore
 
Old 11-21-2011, 06:46 PM   #23
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by engrmilad View Post
well then just dont read my posts then and fuck up
I understand your anger at what to you may seem like a less than helpful attitude displayed by most replies here*. That said however you have absolutely no reason to behave in this way.

So cut it out and start asking the right questions.



* @all: one reply of "please do not post homework questions verbatim, ask questions the right way" should suffice. Two is more than enough but three or more is pushing it. Piling in or what borders on the provocative is not what we need at LQ. So no more of that after this post, OK?
 
1 members found this post helpful.
Old 11-21-2011, 07:47 PM   #24
engrmilad
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
I understand your anger at what to you may seem like a less than helpful attitude displayed by most replies here*.
thank you very much mate for understanding.. I really appreciate it..
 
Old 11-21-2011, 07:48 PM   #25
Linux_Kidd
Member
 
Registered: Jan 2006
Location: USA
Posts: 737

Rep: Reputation: 78
Quote:
Originally Posted by engrmilad View Post
Brother I appreciate your help for me.. thank you very much you are the best..
i was just giving you some basic problem solving tips in the context of your homework. use Google to search for examples that are relevant, then modify them until your code does what the questions ask. the bottom line is, you need basic problem solving skills if you are planning on having a career that has anything to do with computers.

once you get some basic code together and you want more help, post the code along with specific relevant questions and you'll get more help from the tech savvy folks here.

i think what most of us have been telling you is, your fingers have to get more workout than ours, so start typing, etc.

Last edited by Linux_Kidd; 11-21-2011 at 07:49 PM.
 
Old 11-21-2011, 08:00 PM   #26
engrmilad
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Linux_Kidd View Post
i was just giving you some basic problem solving tips in the context of your homework. use Google to search for examples that are relevant, then modify them until your code does what the questions ask. the bottom line is, you need basic problem solving skills if you are planning on having a career that has anything to do with computers.

once you get some basic code together and you want more help, post the code along with specific relevant questions and you'll get more help from the tech savvy folks here.

i think what most of us have been telling you is, your fingers have to get more workout than ours, so start typing, etc.
yeah ok no worries
 
Old 11-21-2011, 11:59 PM   #27
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
I only read the first post and skimmed all the drama posts.

Here are some topics for you to google without the quotes. I've broken them down by problem instead of giving you a big list so you'll hopefully be a little more organized. BTW everywhere you see "man something" then you can type that in your SSH console (putty).

PART 1)
  • "interactive command bash"
  • "pipes bash"
  • "howto script options bash"
  • "man cp"
  • "man mv"
  • "man mkdir" (look at the -p switch)
  • "man tar"
  • "man gzip"

Your teacher gave you a list of files you need to back up so make a temporary directory for instance in /tmp/compfiles and then tar that directory and run it through gzip using pipes '|'. That should be more than enough information to get you started.

PART 2)
  • "man cut" (in particular the -f switch and -d switch.)
  • "man grep" (you don't have to read too much here since your teacher already gave you the command)
  • "redirect output bash"
  • "what is tilde bash"
  • "pipes bash"

PART 3)
  • "functions bash"
  • "interactive command bash"
  • "pipes bash"

The rest will basically use commands from your teacher's script. If you see a command in the script which you don't understand you can either type "man somecommand" where somecommand is the command you don't understand or you can google "man somecommand".

PART 4)
  • "man curl" (see also the EXIT CODES part of the man page as this will help determine the status of a run command)
  • "exit codes bash" (I'll give you a hint, the exit status zero '0' means that the command ran successfully)
  • "conditional bash" (will teach you how you can handle the exit codes)

I'll give you a big hint but you'll still have to work out the details on your own.
Code:
curl http://google.com
echo $?
curl http://fart
echo $?
If you actually read most or all of the documentation I have specified so far then you shouldn't have any trouble in my above descriptions.

PART 5)
  • "test nic snmp"
  • "man snmptest"
  • "man snmpwalk"

I'm a little less versed in this topic though I have some experience. I'm not sure what your teach means by graph it so perhaps someone else could elaborate on that.

Be prepared.
Doing the assignments I outlined above (assuming you know nothing about Linux and Bash in general) will take you about 4-5 hours of reading and comprehension and an additional 2-3 hours of doing the assignments since you have no prior experience with the discussed utilities. I tell you how much time it takes to do it in the hopes that you won't procrastinate because this isn't something which can easily be done.

ALSO NOTE
Your teacher isn't dumb about Linux. They sound like they know what they are doing. I'm sure he had a class earlier in the term where they teach you how to use vim and the man pages (i.e. manual pages for all the commands) which you might have missed. I'm not scolding you just telling you how it is because I too was the type who always skipped my classes and decided to do the homework later.

SECOND NOTE << this one's important
The research I have presented to you (google searches included) took me about 1.5-2hrs to prepare and that includes writing up this post. As you can imagine it is quite strenuous work.

The only reason why I outlined your problems like I did was to assist your "short notice" request and to help redeem the community's fault where pointed out by unSpawn, a moderator here. I rarely do that and did this on a whim. I likely would have reacted similar to the other community members if I were in a different mood. You have to realize that we're a common community (which you are now a part of) of hobbyists and professionals who enjoys discussing Unix and Linux topics. We do not get paid and are putting in our own time and effort in good faith that you are doing an equal amount or more of work in the research process. We do assist people with homework from time to time but we never like to see someone put in minimal effort (like your first post) who expect to get something out of it. Please keep that in mind for when you post in the future and I would advise not insulting anyone. Eventually people will stop responding to your current and future posts entirely if you're rude enough. Just some friendly advice so don't take it in the wrong tone.

SAM

Last edited by sag47; 11-22-2011 at 12:15 AM.
 
5 members found this post helpful.
Old 11-22-2011, 03:23 AM   #28
engrmilad
LQ Newbie
 
Registered: Nov 2011
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sag47 View Post
The only reason why I outlined your problems like I did was to assist your "short notice" request and to help redeem the community's fault where pointed out by unSpawn, a moderator here.
SAM
Brother thank you very much for your beautiful efforts and I really appreciate your respected personalty to spend time on trying to help me to get in the right direction, I really don't know what to say more than you are very generous.. Thank You and I will start search and read trying to learn something quickly in this lost time and hopefully do it ..

heaps of thanks brother..

 
0 members found this post helpful.
Old 11-22-2011, 01:56 PM   #29
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
as the old saying goes
'give a person a fish, they eat tonight. Teach them to fish, they never go hungry'
 
Old 11-22-2011, 02:47 PM   #30
BradMarks
LQ Newbie
 
Registered: Jul 2011
Location: Los Angeles, CA
Distribution: rhel6
Posts: 26

Rep: Reputation: Disabled
Talking Yes, I'm a smarta$$

Quote:
Originally Posted by frieza View Post
as the old saying goes
'give a person a fish, they eat tonight. Teach them to fish, they never go hungry'

Oh I thought it was give a man a match, he's warm for a minute.
Set a man afire, he's warm for the rest of his life.
 
0 members found this post helpful.
  


Closed Thread



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
boot sector and lilo collapse !!!!! URGENT URGENT URGEN !!!!! frelihm Linux - Software 21 12-02-2009 10:21 AM
Urgent : creating folder using bash script prernasin Linux - Newbie 2 09-26-2007 01:58 AM
need urgent help with bash script ferradura Linux - General 4 09-11-2007 04:32 PM
Urgent Urgent !!!! Mozilla Keeps All Your Deleted Emails !!!! odin123 Linux - Software 2 01-31-2004 02:22 AM

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

All times are GMT -5. The time now is 10:57 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
Open Source Consulting | Domain Registration