03-28-2008
Hi,
Try out the code given below, I use ksh and It works in that.
#! /bin/sh
if [[ ($# -eq 0) || ($# > 3) ]]
then
echo "blah bla bla"
else
exit
fi
Hope this works for you.
10 More Discussions You Might Find Interesting
1. Programming
I have a program which I wish to modify. It used to be run from the command line, but now I wish to change this so it can be used as a function.
The program has complex argument processing so I want to pass my paramters to as if it were being called by the OS as a program.
I have tried to... (2 Replies)
Discussion started by: mbb
2 Replies
2. Programming
I searched on the forums. No advises.
I am using a previous source code. I changed the main function main(int argc, char **argv) in a function misc(int argc, char **argv). How do you use the argc and argv parameters? This is how I am calling the function :
char param;
strcat(param,"wgrib ");... (4 Replies)
Discussion started by: Akeson Chihiro
4 Replies
3. Shell Programming and Scripting
I have a script that asks a bunch of questions using the following method for input:
print "Name:";
while(<>){
chomp;
$name=$_;
}
So for example, if the questions asked for name, age, & color (in that order)... I want to be able to easily convert $ARGV into the input expected by... (2 Replies)
Discussion started by: jjinno
2 Replies
4. Programming
Hi C experts,
I have the following code for adding command line option for a program
int main (argc, argv)
int argc;
char *argv;
{
char *mem_type; //memory type
char *name; //name of the memory
int addr; //address bits
int data; ... (5 Replies)
Discussion started by: return_user
5 Replies
5. Shell Programming and Scripting
Hello all,
Had a quick question:
In a typical csh script should inputting via stdin (i.e. set i = $< ) increase the value of $#argv ?
echo enter an value:
set val= "$<"
if($#argv == 0) then
echo No args
else
echo The arg is $argv
so if a value is inputted #argv... (1 Reply)
Discussion started by: new2C
1 Replies
6. Programming
Hi,
Can somehelp help how to list file in a dir? (5 Replies)
Discussion started by: Learnerabc
5 Replies
7. Programming
when i run my program, i have a parameter, that i want to set the value to another string
i am using
int main(int argc, char **argv) {
char my_str=argv;
printf("%s",my_str);
return 0;
}
and i get
Segmentation fault
ran using
./my_prog /usr/share/dict/words hello1
... (2 Replies)
Discussion started by: omega666
2 Replies
8. Programming
I'm working on my own pow function and I need to make a copy of *argv but
I think that I am having trouble with the size of *argv and the size of any array that I
make. The code below isn't working for me. and I want to accept any number no
matter the size with pow -f 2 2. I was working out... (16 Replies)
Discussion started by: Errigour
16 Replies
9. UNIX for Advanced & Expert Users
All of my machines (various open source derivatives on x86 and amd64) store argv above the stack (at a higher memory address). I am curious to learn if any systems store argv below the stack (at a lower memory address).
I am particularly interested in proprietary Unices, such as Solaris, HP-UX,... (9 Replies)
Discussion started by: alister
9 Replies
10. UNIX for Dummies Questions & Answers
So i am trying to read in file
readFile <GivenFile> modFile
looking for a regular file under the directories in the GivenFile and print them out is my over all goal.
basically I am looking for anything that looks like a directory in the given file and printing it out.
Since I am trying to do... (2 Replies)
Discussion started by: squidGreen
2 Replies
IDLE(1) General Commands Manual IDLE(1)
NAME
IDLE - An Integrated DeveLopment Environment for Python
SYNTAX
idle [ -dins ] [ -t title ] [ file ...]
idle [ -dins ] [ -t title ] ( -c cmd | -r file ) [ arg ...]
idle [ -dins ] [ -t title ] - [ arg ...]
DESCRIPTION
This manual page documents briefly the idle command. This manual page was written for Debian because the original program does not have a
manual page. For more information, refer to IDLE's help menu.
IDLE is an Integrated DeveLopment Environment for Python. IDLE is based on Tkinter, Python's bindings to the Tk widget set. Features are
100% pure Python, multi-windows with multiple undo and Python colorizing, a Python shell window subclass, a debugger. IDLE is cross-plat-
form, i.e. it works on all platforms where Tk is installed.
OPTIONS
-h Print this help message and exit.
-n Run IDLE without a subprocess (see Help/IDLE Help for details).
The following options will override the IDLE 'settings' configuration:
-e Open an edit window.
-i Open a shell window.
The following options imply -i and will open a shell:
-c cmd Run the command in a shell, or
-r file
Run script from file.
-d Enable the debugger.
-s Run $IDLESTARTUP or $PYTHONSTARTUP before anything else.
-t title
Set title of shell window.
A default edit window will be bypassed when -c, -r, or - are used.
[arg]* and [file]* are passed to the command (-c) or script (-r) in sys.argv[1:].
EXAMPLES
idle Open an edit window or shell depending on IDLE's configuration.
idle foo.py foobar.py
Edit the files, also open a shell if configured to start with shell.
idle -est "Baz" foo.py
Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell window with the title "Baz".
idle -c "import sys; print sys.argv" "foo"
Open a shell window and run the command, passing "-c" in sys.argv[0] and "foo" in sys.argv[1].
idle -d -s -r foo.py "Hello World"
Open a shell window, run a startup script, enable the debugger, and run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in
sys.argv[1].
echo "import sys; print sys.argv" | idle - "foobar"
Open a shell window, run the script piped in, passing '' in sys.argv[0] and "foobar" in sys.argv[1].
SEE ALSO
python(1).
AUTHORS
Various.
21 September 2004 IDLE(1)