Skip to content

Tag: bash

Expect: How to iterate over files in a directory?

The following is a bash script which iterate over .csv files within a directory. The question is, I now have an expect script #!/usr/bin/expect where I want to use the same for loop. How could I achieve that? Answer You would write: Expect is an extension of Tcl. In addition to the expect man page, a link to …

Get variable name while iterating over array in bash

What I have is an array with some variables. I can iterate to get the values of those vars but what I need is actually their names (values will be used elsewhere). Going with var[i] won’t work cause I will have different names. I guess I could workaround this by creating another array with the names &#8…

Losing stdout data in python

I’m trying to make a python script which is going run a bash script on a remote machine via ssh and then parse its output. The bash script outputs lot of data (like 5 megabytes of text / 50k lines) in stdout and here is a problem – I’m getting all the data only in ~10% cases. In other 90%

Symbolic link difference between cp -sr and ln -s [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …