01-30-2017
Any system you will encounter nowadays will most likely contain a POSIX compliant shell. So I would code for that and I really do not see a need for backticks anymore.
There hardly is a reason nowadays why a new script would need to be able to run in a Bourne shell, which would require the backticks..
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: gjkeenan
5 Replies
2. Shell Programming and Scripting
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)
Discussion started by: jeriryan87
3 Replies
3. UNIX for Dummies Questions & Answers
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)
Discussion started by: bjb
5 Replies
4. Shell Programming and Scripting
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)
Discussion started by: mglenney
2 Replies
5. Shell Programming and Scripting
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)
Discussion started by: msarro
1 Replies
6. Red Hat
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)
Discussion started by: austinharris43
6 Replies
7. Shell Programming and Scripting
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)
Discussion started by: perl_beginner
3 Replies
8. Shell Programming and Scripting
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)
Discussion started by: metallica1973
0 Replies
9. Shell Programming and Scripting
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 FREEBSD
mac_free
MAC_FREE(3) BSD Library Functions Manual MAC_FREE(3)
NAME
mac_free -- free MAC label
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/mac.h>
int
mac_free(mac_t label);
DESCRIPTION
The mac_free() function frees the storage allocated to contain a mac_t.
RETURN VALUES
The mac_free() function always returns 0. WARNING: see the notes in the BUGS section regarding the use of this function.
SEE ALSO
mac(3), mac_get(3), mac_prepare(3), mac_set(3), mac_text(3), posix1e(3), mac(4), mac(9)
STANDARDS
POSIX.1e is described in IEEE POSIX.1e draft 17. Discussion of the draft continues on the cross-platform POSIX.1e implementation mailing
list. To join this list, see the FreeBSD POSIX.1e implementation page for more information.
HISTORY
Support for Mandatory Access Control was introduced in FreeBSD 5.0 as part of the TrustedBSD Project.
BUGS
POSIX.1e specifies that mac_free() will be used to free text strings created using mac_to_text(3). Because mac_t is a complex structure in
the TrustedBSD implementation, mac_free() is specific to mac_3, and must not be used to free the character strings returned from
mac_to_text(). Doing so may result in undefined behavior.
BSD
December 21, 2001 BSD