The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find and replace command in one line using one command vasikaran UNIX for Dummies Questions & Answers 10 08-20-2008 07:40 AM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 03:06 PM
$line command problem victorin Shell Programming and Scripting 3 07-21-2006 07:26 AM
problem with new line mskcc Shell Programming and Scripting 8 04-06-2006 06:00 AM
Sed new line problem Cordially UNIX for Dummies Questions & Answers 1 03-03-2004 08:53 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-09-2007
Registered User
 

Join Date: Oct 2007
Posts: 9
problem with command line

i have a command line that looks like this:
my_command -a -b -c -d"foo bar" "./run this" param1 param2

I'm using getopt to pharse parameters -a -b -c -d.
after that i would like to execute "./run this" param1 param1 (which is places after --) but I'm loosing quotas around ./run this. How can i do this?

Here's the code:

Code:
#zczytanie parametrów
set +e
argumenty=$(getopt -o tmsdi:f:c: -- "$@")
if [ $? -ne 0 ]
then
    wyswietl_pomoc
fi
set -e

#przejście po argumentach i ustawienie odpowiednich flag
eval set -- "$argumenty"
for i
do
    case "$i"
    in
	-t)
	    czy_czas=$PRAWDA
	    shift;;
	-m)
	    czy_pamiec=$PRAWDA
	    shift;;
	-s)
	    czy_ogolne=$PRAWDA
	    shift;;
	-d)
	    czy_szczegolowe=$PRAWDA
	    shift;;
	-i)
	    bylo_co_jaki_czas=$PRAWDA
	    co_jaki_czas=$2
	    shift;shift;;
	-f)
	    format_wypisywania=$2
	    shift;shift;;
	-c)
	    ile_razy=$2
	    shift;shift;;
	--) shift; break;;
    esac
done

#przypisanie polecenia
polecenie="$@"
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:33 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0