The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
one question for bash shell script zx1106 Shell Programming and Scripting 9 03-10-2008 12:40 AM
Bash shell script outthere_3 UNIX for Dummies Questions & Answers 2 01-31-2008 08:13 PM
bash shell script and ms-dos space13 Shell Programming and Scripting 1 11-10-2006 07:06 PM
need help with bash shell script vmtailor UNIX for Dummies Questions & Answers 2 03-03-2005 04:30 PM
bash shell script norsk hedensk Shell Programming and Scripting 4 08-02-2003 08:27 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-30-2006
flamethrower0 flamethrower0 is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 1
BASH Shell Script Help -HELP!

Im a newbie to shell scripting - in fact you could even call me a Linux newbie, well, mabye not i started with CYGWIN a year ago... but i only just recently wiped the Windoze partition off my drive.
-Anyways, heres the script i have a problem with:
Code:
#!/bin/bash
#
#PeMPcoder

function invertconsole () {
echo -e "\033[7m"
}

function defconsole () {
echo -e "\033[0m"
}

function setinput () {
echo -e "file to encode:"
invertconsole
read file2encode
defconsole
}

function setoutput () {
echo -e "output PMP file(default is $file2encode.PMP)"
invertconsole
read pmpout
defconsole
}

function sudogui () {
while [ ! -n $inputfilefound ]
do
if test -n $file2encode -a "$file2encode" != ""
inputfilefound="yesitsdeclared"
else <--- Problem 'round here
setinput
fi
done
echo "succesful"
} 

sudogui

exit
HELP PLEASE

Last edited by flamethrower0; 12-30-2006 at 12:54 AM..
  #2 (permalink)  
Old 12-30-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
We already have a poll for this in the Unix Lounge area. Please go there and vote for your favourite Linux distro. I have closed this poll.
  #3 (permalink)  
Old 12-30-2006
DeepakS's Avatar
DeepakS DeepakS is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 74
Code:
#!/bin/sh
#
#PeMPcoder

function invertconsole () {
echo -e "\033[7m"
}

function defconsole () {
echo -e "\033[0m"
}

function setinput () {
echo -e "file to encode:"
invertconsole
read file2encode
defconsole
}

function setoutput () {
echo -e "output PMP file(default is $file2encode.PMP)"
invertconsole
read pmpout
defconsole
}

function sudogui () {
while [ ! -n $inputfilefound ]
do
if $(test -n $file2encode -a "$file2encode" != "") # Invokes subshell so the return value of test is 
                                                   # checked. Backticks (``) could also be used.
	then inputfilefound="yesitsdeclared"       # If must be followed by a then directive
else
setinput
fi
done
echo "succesful"
} 

sudogui

exit
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:48 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0