Linked Questions
                        14 questions linked to/from Send string to stdin
                    
                
            
            
                0
            
            votes
        
        
            
                2
            
            answers
        
        
            
                385
            
            views
        
        
            
            
        Correct way to assign regex replace to a variable in bash [duplicate]
                    I am trying to assign a variable to the result of a regex substitution in bash. For instance, when I run
echo $initialvar | perl -pe 's/.+(Some_Dir\/)(.+)/\2/'
I get the desired output from the echo....
                
            
       
        
            
                -3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                615
            
            views
        
        
            
            
            
        How to automate OPENVPN login [duplicate]
                    I created a very simple bash script.  The first line of the script after #!/bin/bash accesses my vpn service using an OPENVPN file provided by the VPN Vendor.  It works as expected and then waits for ...
                
            
       
        
            
                1
            
            vote
        
        
            
                0
            
            answers
        
        
            
                48
            
            views
        
        
            
        How to send text from stdin to a script [duplicate]
                    Other than doing:
$ ./script < myfile.txt
Is there a way to pass text directly in the command-line, for example something like:
./script < "hello this is not a test"
The program I ...
                
            
       
        
            
                -1
            
            votes
        
        
            
                2
            
            answers
        
        
            
                31
            
            views
        
        
            
            
        How to read from stdin Linux and set it as input in python [duplicate]
                    This is a sample code:
var1 = float(input('Enter time interval: '))
print(f'OK, time interval is {var1}')
# doing something with above variable
I want to run this python file like this without ...
                
            
       
        
            
                30
            
            votes
        
        
            
                4
            
            answers
        
        
            
                67k
            
            views
        
        
            
            
            
        Get local variable in terraform console
                    Is there any way to get local variables within Terraform console?
> local.name
unknown values referenced, can't compute value
Seems like Terraform console allows only to check input variables and ...
                
            
       
        
            
                15
            
            votes
        
        
            
                4
            
            answers
        
        
            
                47k
            
            views
        
        
            
            
            
        Pipe, standard input and command line arguments in Bash
                    Consider:
command1 | command2
Is the output of command1 used as standard input of command2 or as command line arguments to command2?
For example,
cat test.sh | grep "hehe"
What is its equivalent ...
                
            
       
        
            
                7
            
            votes
        
        
            
                2
            
            answers
        
        
            
                5k
            
            views
        
        
            
            
            
        Limits of length for the expansion of * in Bash? [duplicate]
                    In Bash
echo *
is almost equivalent to ls.
You can do things like
echo */*-out/*.html > all-my-html-files-on-one-line
Since * is a command line argument then there should be a limit on the ...
                
            
       
        
            
                6
            
            votes
        
        
            
                4
            
            answers
        
        
            
                6k
            
            views
        
        
            
            
            
        IBM MQ 8.0, How to provide username and password to amqsget as command line parameters
                    I have an error popping up after upgrading to IBM MQ 8.0 from 7.5 reason being -
In MQ 8.0, a new function is introduced that requires MQ administrators using remote access to supply the userid and ...
                
            
       
        
            
                5
            
            votes
        
        
            
                2
            
            answers
        
        
            
                4k
            
            views
        
        
            
            
        How to awk or grep a variable, without using echo?
                    I'm working with large variables and to speedup my script I'd like to awk or grep a variable without using echo/printf
what I've tried:
awk "/test/ {for(i=1; i<=100; i++) {getline; print}}" "$var"...
                
            
       
        
            
                -3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                663
            
            views
        
        
            
            
            
        How do I print a number with bash for shell script?
                    Sorry this is a very easy question, how do I print 0 from a shell script? My program is doing scanf for a number, I want the script to enter 0.
I tried echo 0, it doesnt seem to work.
#!/bin/bash
...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                617
            
            views
        
        
            
            
        loop over input in C-code and write data to different files using terminal at once
                    I wrote a C code which extracts data from a binary file which has size around 1 GB. There are 101 (0 to 100)configurations and the C code extracts data for a selected configuration and writes the ...
                
            
       
        
            
                -1
            
            votes
        
        
            
                1
            
            answer
        
        
            
                382
            
            views
        
        
            
            
            
        Arguments of fortran program in bash
                    I run a fortran program with bash:
#!/bin/sh
./program
and the program give three questions. How to give answers/arguments into bash script?
I tried:
#!/bin/sh
echo "1 0 3,1.01" | program
but the ...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                259
            
            views
        
        
            
            
            
        How can I compile a LESS string using lessc
                    Here is an example of how to compile a file:
$lines = [];
exec("lessc $file", $lines, $status);
$output = implode("", $lines);
I would like to compile just a string ideally without creating a ...
                
            
       
        
            
                -3
            
            votes
        
        
            
                1
            
            answer
        
        
            
                57
            
            views
        
        
            
            
            
        One-liner bash script to invoke another script that asks for username and password
                    I need to run the script on Linux OS given by HPE in OVCs and I need to run this on almost all the nodes in all the federations.
Hence I am writing one more small batch file to run that script which ...