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


Closed Thread
  Search this Thread
Old 11-04-2011, 10:36 AM   #16
Juako
Member
 
Registered: Mar 2010
Posts: 202

Rep: Reputation: 84

People are too sensible these days
 
Old 11-04-2011, 10:50 AM   #17
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by bahha View Post
I am trying to do some thing but I get syntax error: unexpected end of file

#!/bin/bash
# first check for root user
if { ! $UID -eq 0 ]; then
echo "this script must be run as root."
[snip]

-------------------------------
so any idea please, because I can't continue with my script

thanks for help
Check the item in red.
 
1 members found this post helpful.
Old 11-04-2011, 05:59 PM   #18
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Zssfssz View Post
I understood that he was using Unix, I just needed a reference starting points. The advantage windows has is that it doesnt need as much know how to make a batch file than a bash file. I just cheeked a book out at the library yseterday called "Unix Shell Programming" I'll read it at school and get back to you. I won't do your homework I'll just try to work out the kinks. And don't be mean to me ether it's not nice
Uhh..wrong. Windows batch programming has just as many flaws/features as bash scripting can have. Syntax, punctuation, etc., are all important. Windows is different than bash, but not easier. If you KNOW something, it's obviously easier than something that you've got to learn new. And a bash script can be as simple as a list of commands...just like it can be in a Windows batch file.

And bahha, I agree totally with MTK358 in post #13...you're not bothering ANYONE, and we're all happy to help you, but you've got to show your work. Posting a verbatim homework question with no evidence that you've tried to do it, won't get you any help. Editing your posts to have all the "#" marks doesn't get you many fans either.
 
Old 11-04-2011, 06:11 PM   #19
SigTerm
Member
 
Registered: Dec 2009
Distribution: Slackware 12.2
Posts: 379

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by MTK358 View Post
it's wrong to just make someone on the Internet do your homework for you.
Correction:
it is wrong to just make someone to do your homework for free. And LQ isn't a place for "doing homework for non-free", so you'll have to play by the rules and show some effort.

Quote:
Originally Posted by bahha View Post
just I want to tell you I am trying to solve my homework alone but I face some problem because
I am beginner and I was starting study linux sense 2 weeks ago, and I am not super professional in linux scripting like you.
Everybody started at that point. Linux system has a lot of documentation, so start reading it. Regarding "bash" shell, I think you should be able to type within terminal "info bash" and start reading.
 
Old 11-05-2011, 12:54 PM   #20
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
WHY did you remove the script you posted? There was no reason for doing that, and it has made it harder to understand what the following posts refer to. Don't be embarrassed by your mistakes, just learn from them.

Not only that, but the large block of hash-marks you replaced it with now breaks the formatting of the page, forcing it to side-scroll and making the thread harder to read. At the very least remove them, please.
 
Old 11-05-2011, 01:07 PM   #21
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Quote:
Originally Posted by Zssfssz View Post
The advantage windows has is that it doesnt need as much know how to make a batch file than a bash file.
AIUI, the dos batch file language is smaller and simpler than most *nix shells. This does mean that there's less to learn up front. However, this simplicity comes at the cost of being less powerful, so in order to do any complex work you have to become expert at various techniques to work around its limitations.

bash and other shells, OTOH, have many powerful features built-in that can make doing the same things almost routine, once you know them.

OTGH, at a basic user level, they're pretty much equivalent. The simplest kind of script is just a list of commands to execute in sequence, exactly the same as a batch file.
 
1 members found this post helpful.
Old 11-15-2011, 08:18 PM   #22
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,602

Rep: Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084
I'm going to close this thread, but if you need any guidance with specific issues you're having (as opposed to simply posting your homework verbatim), please do feel free to post another thread. Welcome to LQ.

--jeremy
 
  


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



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

All times are GMT -5. The time now is 08:02 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