10 More Discussions You Might Find Interesting
1. Programming
Hi friends
When I compile thic program by gcc filename, it shows no error.
But after that if I execute the program gets stuck.
Can any one find out.
#include<stdio.h>
#include<sys/types.h>
#include<sys/mman.h>
#include<stdlib.h>
#include<fcntl.h>
#include<sys/stat.h>... (6 Replies)
Discussion started by: gokult
6 Replies
2. Programming
Hi friends
NO errors, but when I try to execute the program it gets struck.
Can any one find it out.
#include<stdio.h>
#include<sys/types.h>
#include<sys/mman.h>
#include<stdlib.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<unistd.h>
#include<signal.h>
#include<string.h>
... (0 Replies)
Discussion started by: gokult
0 Replies
3. Shell Programming and Scripting
Hi:
I have a touble with executing a variable that stores a unix command string.
The following would be excuted fine:
command='ls -l'
`echo $command`
However, the following gives me an error:
command='(uuencode file1 file1; uuencode file2 file2) | mailx email_id'
`echo... (1 Reply)
Discussion started by: sagewise
1 Replies
4. Shell Programming and Scripting
I'm using whatever the scripting is in this copy of busybox ! So not the full boxed set sometimes.
If I do
cmd="echo fred"
$cmd
the system prints "fred"
if I do
cmd="fred=9"
$cmd
it barfs.
Is there a simple way to put a varabble assignment in a string and execute it?
... (2 Replies)
Discussion started by: dexdyne
2 Replies
5. Shell Programming and Scripting
Hi,
I'm building an installation system that uses separate data
files that contain the individual characteristics of each package.
Within the data file, I would like to incorporate a section that
contains a bash script that is loaded into an array which is
then redirected to bash to be... (13 Replies)
Discussion started by: ASGR
13 Replies
6. Shell Programming and Scripting
Hello everybody!
Here is my problem: I try to write a script that searches for files with several extensions using the find utility. The file extensions are defined in a list so I build a string (variable) of the pattern arguments with these extensions but can't get find working. Here is a code... (3 Replies)
Discussion started by: Ro_land
3 Replies
7. Shell Programming and Scripting
I am executing the below in telnet
#!/usr/bin/ksh
File1=simple.txt # The file to check
LogFile=simple.log # The log file
DelayMax=30 # Timeout delay
Tolerance=2
# BEGIN ##############################
while true
do
StampNow=$(date +%s)/60 # stamp in minutes
... (3 Replies)
Discussion started by: chinniforu2003
3 Replies
8. Shell Programming and Scripting
Hey there,
I am trying to pass a command as argument to a function.
The command shows up in $1.
Now I want to execute this command, but if I do a $1
./sample
"bla/blaprintf: warning: ignoring excess arguments, starting with `bla/bla'
The code is :
#!/bin/ksh
fn()
{
$1
}
fn... (3 Replies)
Discussion started by: shriyer
3 Replies
9. Shell Programming and Scripting
Hi everyone!
I need some help with my shell script :(
I am sending a shell command from a html text input to a cgi. Then, I store it into a variable. For example
var="ps -axu"
echo `$var`
This functions properly. But consider the following...
var="ps -axu | grep root"
Now, I want... (2 Replies)
Discussion started by: Nene
2 Replies
10. Shell Programming and Scripting
Hi,
I am trying to export some 50 tables and i want to write a loop and execute the script for every table. I did for one table and its running. Can any one help me for setting a loop and running the script for all the tables
thanks (6 Replies)
Discussion started by: srichunduru
6 Replies
LUA(1) General Commands Manual LUA(1)
NAME
lua - Lua interpreter
SYNOPSIS
lua [ options ] [ script [ args ] ]
DESCRIPTION
lua is the stand-alone Lua interpreter. It loads and executes Lua programs, either in textual source form or in precompiled binary form.
(Precompiled binaries are output by luac, the Lua compiler.) lua can be used as a batch interpreter and also interactively.
The given options (see below) are executed and then the Lua program in file script is loaded and executed. The given args are available to
script as strings in a global table named arg. If these arguments contain spaces or other characters special to the shell, then they
should be quoted (but note that the quotes will be removed by the shell). The arguments in arg start at 0, which contains the string
'script'. The index of the last argument is stored in arg.n. The arguments given in the command line before script, including the name of
the interpreter, are available in negative indices in arg.
At the very start, before even handling the command line, lua executes the contents of the environment variable LUA_INIT, if it is defined.
If the value of LUA_INIT is of the form '@filename', then filename is executed. Otherwise, the string is assumed to be a Lua statement and
is executed.
Options start with '-' and are described below. You can use '--' to signal the end of options.
If no arguments are given, then -v -i is assumed when the standard input is a terminal; otherwise, - is assumed.
In interactive mode, lua prompts the user, reads lines from the standard input, and executes them as they are read. If a line does not
contain a complete statement, then a secondary prompt is displayed and lines are read until a complete statement is formed or a syntax
error is found. So, one way to interrupt the reading of an incomplete statement is to force a syntax error: adding a ';' in the middle of
a statement is a sure way of forcing a syntax error (except inside multiline strings and comments; these must be closed explicitly). If a
line starts with '=', then lua displays the values of all the expressions in the remainder of the line. The expressions must be separated
by commas. The primary prompt is the value of the global variable _PROMPT, if this value is a string; otherwise, the default prompt is
used. Similarly, the secondary prompt is the value of the global variable _PROMPT2. So, to change the prompts, set the corresponding
variable to a string of your choice. You can do that after calling the interpreter or on the command line (but in this case you have to be
careful with quotes if the prompt string contains a space; otherwise you may confuse the shell.) The default prompts are "> " and ">> ".
OPTIONS
- load and execute the standard input as a file, that is, not interactively, even when the standard input is a terminal.
-e stat
execute statement stat. You need to quote stat if it contains spaces, quotes, or other characters special to the shell.
-i enter interactive mode after script is executed.
-l name
call require('name') before executing script. Typically used to load libraries.
-v show version information.
SEE ALSO
luac(1)
http://www.lua.org/
DIAGNOSTICS
Error messages should be self explanatory.
AUTHORS
R. Ierusalimschy, L. H. de Figueiredo, and W. Celes
$Date: 2006/01/06 16:03:34 $ LUA(1)