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 02-28-2007, 05:30 PM   #1
rp1226
Member
 
Registered: Feb 2007
Distribution: Knoppix 5.1
Posts: 53

Rep: Reputation: 15
Linux programming?!?!


Programming on Linux?

What can I program?

I know I can use C++ and JAVA, but what can I use this for?

Shell programming, ok so I can go from one place to another. What can I do with this, what is the file type for this, and how do i execute these?

I am not new to programming but I am new to Linux, so i am interested on how to program in Linux and what is linux capable of.


Thanks for all of the information.
 
Old 02-28-2007, 05:57 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Every thing that you see and much that you can't see in Linux, someone had to program. Does that narrow it down a bit?
--- rod.
 
Old 02-28-2007, 05:58 PM   #3
rp1226
Member
 
Registered: Feb 2007
Distribution: Knoppix 5.1
Posts: 53

Original Poster
Rep: Reputation: 15
Ok ok, but what I am looking for is what can I do with the shell command that would be helpful for me. Also how do I make a file and how do i execute the files.
 
Old 02-28-2007, 06:09 PM   #4
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
What can you program? Whatever you want within limits of the current state of the art.

For Bash programming (assuming you're using a Bash shell), start here http://tldp.org/LDP/abs/html/index.html. Create the file in a text editor...nano , vi ,vim, emacs, gedit, kate, kedit, mousepad, etc., etc., etc. Set the executable bit on the script file to make it executable
Code:
chmod +x filename
For making executable files using C++, you need to compile it and link it with g++. That will provide you with an executable binary. Start here to learn how to use the compilers provided by gcc http://gcc.gnu.org/onlinedocs/.

Last edited by weibullguy; 02-28-2007 at 06:13 PM.
 
Old 02-28-2007, 06:09 PM   #5
wee-face
LQ Newbie
 
Registered: Jan 2007
Posts: 17

Rep: Reputation: 0
what shell command are you talking about? useful for what exactly? what is it that you hope to achieve?
 
Old 02-28-2007, 06:21 PM   #6
spinelli
LQ Newbie
 
Registered: Aug 2006
Posts: 5

Rep: Reputation: 0
Quote:
Originally Posted by rp1226
Ok ok, but what I am looking for is what can I do with the shell command that would be helpful for me. Also how do I make a file and how do i execute the files.
Hello and welcome. I don't know a lot about programming, but I think I can help. The only language I know is C++. The compiler you will be using is the gnu compiler.

http://gcc.gnu.org/

At the command line you need to use a text editor such as vim, emacs, or nano to create your source file. Nano will be the easiest to use at first, but vim and emacs are much more powerful. For example:

Code:
nano test.cpp
Then write your code and then save and exit. I believe Ctrl+O is save and Ctrl+X is exit. Next you need to compile. Assuming you have the gnu compiler installed type this:

Code:
g++ test.cpp
Now you should have a file named a.out in your current working directory. Type this to execute it:

Code:
./a.out
Learn more about the GNU/Linux command line:

http://tldp.org/LDP/intro-linux/html/
 
Old 02-28-2007, 06:43 PM   #7
rp1226
Member
 
Registered: Feb 2007
Distribution: Knoppix 5.1
Posts: 53

Original Poster
Rep: Reputation: 15
Thank you Arow, that is what I was talking about, thanks.

Wee-Face, I am using KNOPPIX, I was wondering, If i save my config in a usb i have to run a little program to do it. Can I just run a script to take care of that every time. Maybe Knoppix already takes care of that but that is another question.

spinelli, i appreciate the cpp info. I do have experience programming in JAVA and C++ like I said. But extra info on how to execute was helpful.

Now that we are all still talking about programming, Is it possible for me to program in Windows and test scripts in a shell "emulator?"

Thanks for the input everyone, keep it up.
 
Old 02-28-2007, 07:07 PM   #8
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
If you want a bash enviroment in Windows, try Cygwin. I'm unsure how accurate it is to a real, live, linux system, but the alternative is QEmu and friends. Or perhaps a shell account somewhere.
 
Old 02-28-2007, 07:08 PM   #9
spinelli
LQ Newbie
 
Registered: Aug 2006
Posts: 5

Rep: Reputation: 0
Quote:
Originally Posted by rp1226
Now that we are all still talking about programming, Is it possible for me to program in Windows and test scripts in a shell "emulator?"
Doing a quick google search I found these sites:

http://win-bash.sourceforge.net/
http://www.steve.org.uk/Software/bash/

I have never used any of these programs on Windows before, but it looks like they might be helpful to you. Also try googling "bash on windows" for more information.
 
Old 02-28-2007, 07:18 PM   #10
rp1226
Member
 
Registered: Feb 2007
Distribution: Knoppix 5.1
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks, I'll take a look at those and give a reply on this post. But it seems like it will take care of my needs.

Thanks again spinelli.
 
Old 02-28-2007, 08:06 PM   #11
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
For copying a config file (or set of files) to a USB stick, you just need to put the commands that you use into a text file, and make it executable. For example, if you regularly mount the drive, copy a file to it and unmount it again:
Code:
#! /bin/bash
mount /media/usb
cp /path/to/file /media/usb
umount /media/usb
As for testing scripts on Windows, Cygwin works well. You may find some differences with real Linux as opposed to Cygwin though.

Make the script executable, and run it as was previously shown.

--Ian
 
Old 02-28-2007, 09:17 PM   #12
Sepero
Member
 
Registered: Jul 2004
Location: Tampa, Florida, USA
Distribution: Ubuntu
Posts: 734
Blog Entries: 1

Rep: Reputation: 33
Damn Small Linux embedded. It can be run in emulation mode under Microsoft. http://www.damnsmalllinux.org/download.html
http://gulus.usherbrooke.ca/pub/dist...2-embedded.zip

sep
 
Old 02-28-2007, 10:20 PM   #13
wee-face
LQ Newbie
 
Registered: Jan 2007
Posts: 17

Rep: Reputation: 0
I've used cygwin before and it's really quite useful, it is a
little slow compared to using a bash shell on a real system.

I learned bash scripting with cygwin and got started with
c on cygwin before deciding to finally move on to linux,
but i still use windows occasionally and still have cygwin
installed.
 
Old 02-28-2007, 10:24 PM   #14
wee-face
LQ Newbie
 
Registered: Jan 2007
Posts: 17

Rep: Reputation: 0
I've used cygwin before and it's really quite useful, it is a
little slow compared to using a bash shell on a real system.

I learned bash scripting with cygwin and got started with
c on cygwin before deciding to finally move on to linux,
but i still use windows occasionally and still have cygwin
installed.

If you're using knoppix you will probably have to write a script
to mount your device and store it on a floppy, which you will
then need to mount in order to execute the script, i could be
mistaken.
 
Old 02-28-2007, 10:42 PM   #15
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
And the other approach is to embed windows in Linux, I'm using vmware so when I have to turn to windows it's there...

The question about what can I program is actually a very good question. I know very little about shell scripts because I have little need of them, when I do need them I struggle to get something working. The reason for this is most of my linux work is on the desktop. My view is as a single user doing tasks when I need them. Occasionally scripts are useful but I see them coming into their own when the view is as an administrator of multiple users. So scripts to extract data from log files, to manage user accounts starts to make some sense. When I find myself having to perform such tasks and tend to fall back onto non-shell scripting languages typically PHP because I know it fairly well.

So onto the second arena of programming compiled languages, there is a wealth of tool available on Linux, it's just a case that it takes time to learn these tools. Whatever it is that you program spend a little extra time learning about the debugger, tools that spot memory leeks, tools to create unit tests, tools to create documentation of your code, Each of these are important and will help to make you a better programmer. As to what you can do, if it's to learn do something that you enjoy, whilst keeping the above point in mind, then you will learn much more than you realise. As an example a friend of mine (many year ago) had a passion for music, he was interested in computers and so with some guidance he wrote his own synthesiser program (this was long before these programs were available) he never considered himself a programmer but in his field he was one of the best.
 
  


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
New Forum for Linux-Gurus[Programming/Administration] or Linux-Advanced Users [ Progr raees LQ Suggestions & Feedback 5 04-12-2005 07:35 PM
Exp. Windows/Linux-Script Programmer - Need Linux Programming Mentor! ruttiger Linux - Newbie 2 10-28-2001 11:00 AM

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

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