![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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="$@"
|
|||
| Google The UNIX and Linux Forums |
| Forum Sponsor | ||
|
|