10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hey guys, my first post on UNIX Forums(much overdue IMO)!
I've got this bit of code that doesn't seem to be working correctly for an Android app I'm working on:
"screen -S gmod1 -p 0 -X stuff " & "" & command.text & "`echo -ne '\015'`"""
Basically it types command.text(variable determined... (4 Replies)
Discussion started by: stingwraith
4 Replies
2. Shell Programming and Scripting
Greetings!
Here's what I believe is a "simple one" for the community tonight ;)
What I'm trying to do is assign a "true/false" value to a variable depending upon whether a named process (some-process) exists; and then test for this value in the succeeding logic. I banged my head against the... (2 Replies)
Discussion started by: LinQ
2 Replies
3. Shell Programming and Scripting
hi all ,
i just tried to take the status of previous command inside the script using
echo $?. It throws me a variable syntax error , but when i use echo $? as an individual command it works perfectly .
can anyone Please tell me why am getting a variable syntax error when i use echo $?... (7 Replies)
Discussion started by: Rahul619
7 Replies
4. Shell Programming and Scripting
$ cat data
Do NOT print me
START_MARKER
Print Me
END_MARKER
Do NOT print me
$ cat awk.sh
start=START_MARKER
end=END_MARKER
echo; echo Is this ugly syntax the only way?
awk '/'"$start"'/,/'"$end"'/ { print }' data
echo; echo Is there some modification of this that would work?
awk... (2 Replies)
Discussion started by: hanson44
2 Replies
5. Shell Programming and Scripting
first of all.. sorry about all the question bombing.. im bored atm so im currently playing around with sh scripting hehe
s = `expr ls -s Documents | grep Music | awk '{ print $1 }' `
t = `expr $t + $s`
it give syntax error
s not found
t not found lol...
any idea why? (7 Replies)
Discussion started by: Nick1097
7 Replies
6. Shell Programming and Scripting
Question: How I can change the shell option in my current environment, which I want to change the result of the command echo $-.
Background:
Special variable $-. It means the current shell option, and in my ENV, the result of this command as follows.
-bash-3.2$ echo $-
himBH
-bash-3.2$
... (2 Replies)
Discussion started by: ambious
2 Replies
7. Shell Programming and Scripting
Hi
I use awk command to delete the first blanc line of a file:
awk '/^$/ && !f{f=1;next}1' infile > outfile
can somebody please explain me what the last "1'" in !f{f=1;next}1' stands for... Thansk a lot -A (3 Replies)
Discussion started by: aoussenko
3 Replies
8. UNIX for Dummies Questions & Answers
Hi,
Have to check file names in some given directory.
SO, What is the right syntax here:
*$3*=="'$object_list'" - just wanted to check if $3 is in the object_list.
And also, Do I need so many quotes around? (5 Replies)
Discussion started by: Leo_NN
5 Replies
9. UNIX for Dummies Questions & Answers
I need some syntax help (working in a bash shell)
I have a variable which is a filename with an extension, and I need to create another variable with the same name but a different extension
To explain, the input file should be called something like "filename.L1" and the output file should be... (1 Reply)
Discussion started by: Slanter
1 Replies
10. Shell Programming and Scripting
How to export variables on a UNIX prompt. Please provide me syntax.
Thanks in advance.
Malay (5 Replies)
Discussion started by: malaymaru
5 Replies
explain_setenv_or_die(3) Library Functions Manual explain_setenv_or_die(3)
NAME
explain_setenv_or_die - change or add an environment variable and report errors
SYNOPSIS
#include <libexplain/setenv.h>
void explain_setenv_or_die(const char *name, const char *value, int overwrite);
int explain_setenv_on_error(const char *name, const char *value, int overwrite);
DESCRIPTION
The explain_setenv_or_die function is used to call the setenv(3) system call. On failure an explanation will be printed to stderr, obtained
from the explain_setenv(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_setenv_on_error function is used to call the setenv(3) system call. On failure an explanation will be printed to stderr,
obtained from the explain_setenv(3) function, but still returns to the caller.
name The name, exactly as to be passed to the setenv(3) system call.
value The value, exactly as to be passed to the setenv(3) system call.
overwrite
The overwrite, exactly as to be passed to the setenv(3) system call.
RETURN VALUE
The explain_setenv_or_die function only returns on success, see setenv(3) for more information. On failure, prints an explanation and
exits, it does not return.
The explain_setenv_on_error function always returns the value return by the wrapped setenv(3) system call.
EXAMPLE
The explain_setenv_or_die function is intended to be used in a fashion similar to the following example:
explain_setenv_or_die(name, value, overwrite);
SEE ALSO
setenv(3)
change or add an environment variable
explain_setenv(3)
explain setenv(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2010 Peter Miller
explain_setenv_or_die(3)