I have a problem that when I run my script with no arguments I get the error
Code:
argv: Subscript out of range.
Code:
#!/bin/csh
set rdir = "/uniprg/chrisd/radon/trunk-radon/fradon/source-frt/new-frt"
if ($#argv == 0) then
echo "no arguments passed to radon3d-linear.com"
$rdir/uniseis << EOJ
echo "no arguments
Code of baul :)
Code:
/*
* Hanx [Proyecto Fedora Peru] wth Code
* crc.c - app
*
* This program is private version, for anti-educational purposes and without any
* explicit or implicit warranty; in no event shall the author or
* contributors be liable for any direct, indirect or incidetal damages
argv 3 years 10 weeks ago Hi guys
I use the following code to check if a user has specified a certain argument:
if (strcmp(argv[i], "-i") == 0)
{
// do something
}
I use the following code to check whether any arguments have been specified (e.g. -i test1) but it gives me a segemtation fault if no arg for -i is specified:
I have the following script and I'm getting: too many arguments error
Code:
#!/bin/bash
#creating new dir and copy files into it
create_dir() {
if [ $# -eq 0 ]; then
echo "Usage: $0 param1 param2"
else
echo
I have a tcsh script which I pass arguments to. I want to store all the arguments except for the options.
Currently I am using the line below, however I want to also exclude and variation of them (e.g.
check this code
Code:
#!/usr/bin/expect
set timeout 5
set Machine [lindex $argv 0]
set Username [lindex $argv 1]
set Password [lindex $argv 2]
spawn telnet $Machine
sleep 1
expect {
-re "(ogin:)|(name:)" { send "admin\r"
&
In the following program though most of the working part of the program is commented out, it gives seg fault. reducing the value of MAX to say 10000 removes the seg fault. Why is this happening? it should be only 1 MB only. Is 1 MB too big for an array?
#include <stdio.h>
#define MAX 1000010
int main()
{
Hi all,
here's my script
Code:
#!/bin/ksh
if [ -z "$DB_CREATE_PATH" ]
then
export DB_CREATE_PATH=`pwd`
fi
echo
echo "********************--Menu--*****************************"
echo "***
can anyone offer some help here
i have a string that contains course codes. i separate the string into the individual course codes using the explode function. however i want to run a query on each of the course codes that was present in the string and store the result in an array that i have created this is the code that i have thus far
<?php