Help - Search - Members - Calendar
Full Version: Need Help Writing Script
Linuxhelp > Support > Technical Support
robbmcmahan
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
Joey
Theres tons of different ways to do this.

Here's one way with perl:

CODE
#!/usr/bin/perl

$text = "Hello World!";

print $text;
hughesjr
You can use your shell as well - there are sh, ksh, csh and zsh shells to name a few. The default shell in Linux is bash ... so scripting in sh or bash can be done with no modifications to any startup files.

http://mirrors.sunsite.dk/ldp/HOWTO/Bash-P...ntro-HOWTO.html

(look at the Using select to make simple menus section....)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.