The "problem" is the way parameter expansion is done. Example:
Spot the difference? In the first example, echo is passed 6 parameters (split on the whitespaces), and by default it outputs them using one whitespace as separator. In the second example, the variable is passed as one parameter, whitespaces and all.
Hello,
I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3.
For example:
file 1
123
1234
123456
file 2
123
2345
23456
file 3 should have
2345
23456
I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
I am trying to check to see if a file exists on a ftp server, well, I know that cant be done, atleast directly, So I came up with this small script
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
cd public_html/crap
dir $FILE
quit
END_SCRIPT
Where the $ variable... (2 Replies)
Hi List,
How to read the output of a command executed from a script.
For ex.
sample_scritp.sh
-------------
useradd testuser1
password testuser1
....
.....
--------------
This prompts for "password", and "confirm password", for which i need to give the values from script.
Can... (4 Replies)
hi,
i have a script which pipes the output of a diff -rq command into a separate file/ it would read something like this:
Files mod1/lala/xml/test1.txt and mod2/lala/xml/test1.txt differ
Only in mod2/lala/xml: test2.txt
What i need to do is to parse this file so i end up with just a... (5 Replies)
Hello, in a script i would like to evaluate a command output with a grep, for example, to know if the parameter defined by the user is in the output.
Something like: the_command | grep $1
Please, how is the way to evalulate in this a script, like
if
echo "incorrect parameter, not in... (2 Replies)
I have written shell script to send file as an attachemt of email and output of "top -o res" command as email body. it works fine if i execute manually from prompt but it does not send "top -o res" command output in email body when it is executed via crontab. Any suggestions. My script is below:... (5 Replies)
Hi
I would like to write a shell script which replace particular text in output of a shell command. For example : If I execute pwd (if dir is /users/master/) it should display as - /users/Master_directory/.
Also, for generalising the script I would like to receive parameters when I run the... (3 Replies)
Hi Team,
Need a help on how to pipe a command out put to a shell script. My shell script looks like below.
cat shell_script
#!/usr/bin/ksh
input =$@
echo " we are inside the shell script"
echo " here are the input parameters"
..........................
..................
... (11 Replies)
Hi ,
Can some one help me how to pass ls command output to diff command
ex : - ls *.xml will return files which have time stamps
abc-<time-stamp>.xml
xyz-<time-stamp>.xml
diff abc-<time-stamp>.xml xyz-<time-stamp>.xml >> newfile.txt
we need to... (9 Replies)
Discussion started by: techie_09
9 Replies
LEARN ABOUT CENTOS
systemd-activate
SYSTEMD-ACTIVATE(8) systemd-activate SYSTEMD-ACTIVATE(8)NAME
systemd-activate - Test socket activation of daemons
SYNOPSIS
/usr/lib/systemd/systemd-activate [OPTIONS...] daemon [OPTIONS...]
DESCRIPTION
systemd-activate can be used to launch a socket activated daemon from the command-line for testing purposes. It can also be used to launch
single instances of the daemon per connection (inetd-style).
The daemon to launch and its options should be specifed after options intended for systemd-activate.
If the -a option is given, file descriptor of the connection will be used as the standard input and output of the launched process.
Otherwise, standard input and output will be inherited, and sockets will be passed through file descriptors 3 and higher. Sockets passed
through $LISTEN_FDS to systemd-activate will be passed through to the dameon, in the original positions. Other sockets specified with
--listen will use consecutive descriptors.
OPTIONS --help, -h
Prints a short help text and exits.
--version
Prints a short version string and exits.
-l address, --listen=address
Listen on this address. Takes a string like "2000" or "127.0.0.1:2001".
-a, --accept
Launch a separate instance of daemon per connection and pass the connection socket as standard input and standard output.
-E VAR[=VALUE], --environment=VAR[=VALUE]
Add this variable to the environment of the launched process. If VAR is followed by "=", assume that it is a variable-value pair.
Otherwise, obtain the value from the environment of systemd-activate itself.
ENVIRONMENT VARIABLES
$LISTEN_FDS, $LISTEN_PID
See sd_listen_fds(3).
$SYSTEMD_LOG_TARGET, $SYSTEMD_LOG_LEVEL, $SYSTEMD_LOG_COLOR, $SYSTEMD_LOG_LOCATION
Same as in systemd(1).
EXAMPLE 1
$ /usr/lib/systemd/systemd-activate -l 2000 -a cat
This runs an echo server on port 2000.
EXAMPLE 2
$ /usr/lib/systemd/systemd-activate -l 19531 /usr/lib/systemd/systemd-journal-gatewayd
This runs a socket activated instance of systemd-journal-gatewayd(8).
SEE ALSO systemd(1), systemd.socket(5), systemd.service(5), cat(1)systemd 208SYSTEMD-ACTIVATE(8)