Need help with redirection in bash. Where to dig?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
11 views
Good day! The task is simple, and everything should in theory work, but a little not.
There is a bash script, it is one variable
Need to get with the servers txt file and parse that variable using the pipe commands, which are written in this file

In the console I do this:

asterisk -rx 'gsm send ussd 1 *112*1#' | cut-d' ' -f2 | tail -n 1 | awk -F ":" '{print $1}' 1156


everything works

now I take
cut-d' ' -f2 | tail -n 1 | awk -F ":" '{print $1}' and placed in the file on the server http://192.168.240.47/ussdkstregexp.txt


and perform:
asterisk -rx 'gsm send ussd 1 *112*1#' | `wget-qO - http://192.168.240.47/ussdkstregexp.txt`

not working.
what could be the problem?
by | 11 views

2 Answers

0 like 0 dislike
Jaroslav when you run the command
wget-qO - http://192.168.240.47/ussdkstregexp.txt
the program wget (GNU Wget is a free utility for non-interactive download of files from the Web) loads the specified file from a web server, and based on the key -O- displays its contents to standard output (stdout).
So, if you want the data downloaded from a file on a web server, and bred to stdout, use next, just through the conveyor pass the output of wget command:
wget-qO - http://192.168.240.47/ussdkstregexp.txt | next_command
by
0 like 0 dislike
IMHO the big distorted to do hitrozh***s odnotrahniki, although it is theoretically possible to make such odnotrahniki, pomahival with the flow.
minus one not many will understand it, and in a month you get mozgovat "what have I done"

maybe just asterisk -rx 'gsm send ussd 1 *112*1#' | cut-d' ' -f2 | tail -n 1 | awk -F ":" '{print $1}' to put in the file
then you can swing and redirect in bash, bash will handle commands from the stream.
it will be much easier to work understanding.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
asked Mar 24, 2019 by KriegeR
0 like 0 dislike
1 answer
asked May 21, 2019 by leonid_073
0 like 0 dislike
4 answers
110,608 questions
257,186 answers
0 comments
35,595 users