Can someone explain the difference between backticks and system when
evaluated in these if statements:
sub getDate {
print "start date\n";
if ( system("/bin/date") ) {
print "can't get date\n";
exit(2);
}
print "finish date\n";
}
Returns the following:
start date
Thu... (5 Replies)
Hi, I'm trying to do something like this: range= `expr `date '+%m'` - 1` and it does not work. How can I tell it to evaluate an expression within another expression evaluation? I was at first worried that `date '+%m'` would return a string but apparently expr does the math okay normally, so the... (3 Replies)
Hi,
I would like to change some lines in my mysql-dump, because there a syntax problems with some version of mysql.
I 'd like to change
USE ´someDatabase´;
to
USE someDatabase;
(without backticks) using the sed command in the shell
Thanks & best regards
Bernd (5 Replies)
I'm always concerned I might be abusing backticks within my scripts. A current script I'm writing has this for example:
stripscriptname=`echo $scriptname | sed 's/\(.*\)\..*/\1/'`
stripsearch=`echo $searchpattern | tr -d ' ,/'`
Both of these variables are set inside the script (in fact,... (2 Replies)
Hey all. Just a fast question, what is the technical difference between using back ticks and using xargs to perform a command?
Here's an example
Find /mydir -name *.conf |xargs rm
Vs
Rm 'find /mydir -name *.conf'
Is there a performance hit? I know they do the same thing but which is... (1 Reply)
Hi everyone. This is a bit of a perl/linux mixed question. I am trying to redirect STDOUT of chsh by using the following line of perl code.
system ("chsh -s /sbin/nologin $testing 1>/dev/null");
This should redirect STDOUT to /dev/null but it won't do that for some odd reason. Any ideas or... (6 Replies)
Input file:
'data_1'
'data_10'
'data1311'
'235data_13'
Desired output:
data_1
data_10
data1311
235data_13
Can I know how to remove back tick"'" in a file?
Many thanks for advice. (3 Replies)
I have been testing a new script and cannot figure out why my `cat spath` will not execute on the remote machine?
sudo ssh -p 22344 -o "PasswordAuthentication no" -o "HostbasedAuthentication yes" -l testuser 192.168.1.6 "find `cat spath` -depth"
cat: spath: No such file or directory
but... (0 Replies)
I'm trying to make a dialog window that prints the output of grep that takes the output of find. Unfortunately my nested backticks don't work.
Here is the dialog window:
dialog --stdout --title "test" --backtitle "test" --msgbox "Test:\n `grep -l "${tablica}" `find $string``" 16 60I think I... (2 Replies)
Discussion started by: Starting_Leaf
2 Replies
LEARN ABOUT OSF1
putenv
putenv(3) Library Functions Manual putenv(3)NAME
putenv - Sets an environment variable
LIBRARY
Standard C Library (libc.so, libc.a)
SYNOPSIS
#include <stdlib.h>
int putenv(
const char *string);
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
putenv(): XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Points to a name=value string.
DESCRIPTION
The putenv() function sets the value of an environment variable by altering an existing variable or by creating a new one. The new envi-
ronment variable remains in effect even after the program setting it is exited.
The string parameter points to a string of the form "name=value", where name is the environment variable and value is the new value for it.
NOTES
The putenv() function manipulates the environ external variable, and it can be used in conjunction with the getenv() function. However, the
third parameter to the main function (the environment pointer) is not changed.
The putenv() function uses the malloc() function to enlarge the environment.
A potential error is to call putenv() with an automatic variable as the argument and then exit the calling function while string is still
part of the environment.
RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. If the malloc() function is unable to obtain sufficient space to expand the
environment, the putenv() function returns a nonzero value.
RELATED INFORMATION
Functions: clearenv(3), exec(2), getenv(3), malloc(3)
Standards: standards(5) delim off
putenv(3)