Linked Questions

0 votes
0 answers
585 views

What is causing this script to exit the loop at line "program is exiting loop here"? In the context it will loop twice but it won't if i have the CM_CHECK_STATUS where i have it. RUNLOG=&...
jtlindsey's user avatar
  • 333
0 votes
1 answer
54 views

For some reason, this script (run on RHEL v6.9) processes only the first line in the host_file #!/bin/bash process() { ssh $host ls } while IFS= read -r host do echo "Running $host" process ...
humility's user avatar
  • 143
240 votes
9 answers
328k views

I wrote the following script to diff the outputs of two directores with all the same files in them as such: #!/bin/bash for file in `find . -name "*.csv"` do echo "file = $file"; diff $...
Amir Afghani's user avatar
  • 7,373
93 votes
7 answers
348k views

I have a variable which contains multiline output of a command. What's the most effecient way to read the output line by line from the variable? For example: jobs="$(jobs)" if [ "$jobs" ]; then #...
Eugene Yarmash's user avatar
106 votes
9 answers
72k views

I know you can create a file descriptor and redirect output to it. e.g. exec 3<> /tmp/foo # open fd 3. echo a >&3 # write to it exec 3>&- # close fd 3. But you can do the same ...
dogbane's user avatar
  • 30.8k
107 votes
4 answers
151k views

It seems that normal practice would put the setting of IFS outside the while loop in order to not repeat setting it for each iteration... Is this just a habitual "monkey see, monkey do" style, as it ...
Peter.O's user avatar
  • 33.8k
43 votes
2 answers
62k views

I am having a very hard time understanding how does one use file descriptors in shell scripts. I know the basics such as exec 5 > /tmp/foo So fd 5 is attached to foo for writing. exec 6 < /...
Ricko M's user avatar
  • 825
5 votes
2 answers
412 views

It seems the Bash built-in help command help does some really strange globbing: help read shows the documentation for read, readarray and readonly. help rea? shows only the documentation for read. ...
l0b0's user avatar
  • 53.6k
0 votes
2 answers
487 views

Let say in a text file if I do grep FINAL *.msg it returns FINAL COMPUTATIONS: Elapsed Time: 000:30:55.65; CPU Time: 000:30:26.53 FINAL COMPUTATIONS: Elapsed Time: 000:28:11.77; CPU Time: ...
Akand's user avatar
  • 69
1 vote
1 answer
682 views

I'm trying to learn (with no programming background) to create some custom bash scripts for converting selected files from Nautilus, but I hit an issue I can't understand. For reference, this is a ...
eldelacajita's user avatar
2 votes
1 answer
223 views

I have a script that runs a python script (used to deduplicate emails via IMAP) after a user has entered a servername, username & password. The first part of it gets a list of folders which the ...
lippyrich's user avatar
0 votes
2 answers
296 views

I'm trying to put together a generic script that will check the existence of several key directories for various users on different servers. Additionally, I want to leverage each user's $HOME variable....
user26241's user avatar
1 vote
1 answer
109 views

I have a text file like this chr1:16840617-16840780 RNU1-1 (2 columns are tab separated) chr3:142139047-142139211 RNU1-100P ............ ............ I want to loop over the lines ...
user3138373's user avatar
  • 2,589
1 vote
2 answers
69 views

Wondering if there is a best way to call directory names and iterate as parameter from a list. Example cat /dropbox/script/DirList.txt DIR_A DIR_B DIR_C DIR_D /dropbox/dev/inbox/<DIR_A>/ *.* /...
user2292524's user avatar