LinuxQuestions.org
Help answer threads with 0 replies.
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 09-10-2003, 01:10 PM   #1
robbmcmahan
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Rep: Reputation: 0
Writing script for Linux


Hi,

I am a linx newbie and needing to write a simple external command for Linux. What language do I use? perl? If so, i'm not that great with perl ...i'm mostly a PHP, JavaScript, sorta guy. So, i'm hoping someone can help me. All I need to do is to write a script that will look for a string input and then run a command with the string in it. Like this:

The string variable input:
"hello, how are you?"

The scripts output:
echo "string variable"

I know this will be a simple script I just need to know what language I use for shell scripting in linux and hoping someone can show me somthing using the example above so I can see the syntax from this to get me started.

Much thanks

Thanks
 
Old 09-10-2003, 01:24 PM   #2
mrnikeswsh
Member
 
Registered: Aug 2003
Distribution: MNF
Posts: 41

Rep: Reputation: 15
me too!

I would be interested in this as well.. I'm a computer nerd at heart and just installed mandrake 9.1


I wanna play with some of the programming within Mandrake.

bZ
 
Old 09-10-2003, 01:36 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Stupid Bash script example:
Code:
#!/bin/bash
echo "Please enter any input. <blank line><enter> to exit."
while read; do
case "${#REPLY}" in 
0) exit 0;; 
*) echo "${REPLY}";;
esac
done
 
Old 09-10-2003, 02:05 PM   #4
robbmcmahan
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Perfect....

I know it was a stupidly simple....i just needed to see the syntax.

Thanks
 
  


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
writing a script to do linux taskes.. kevinm2 Linux - Software 3 06-17-2005 01:49 PM
First time writing a Linux Script !!!! ptreves Linux - Newbie 5 04-06-2005 03:22 PM
Help writing a rm script VisionZ Linux - Newbie 17 03-24-2004 07:15 AM
Writing a Script Nyc0n Linux - General 2 05-27-2002 07:21 PM
writing a Script spanky5125 Linux - Security 5 01-08-2002 09:22 AM

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

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