1
vote
1answer
94 views

How does bash execute an ELF file?

When I'm on my Linux Box I use bash as a shell. Now I wondered how bash handles the execution of an ELF file, that is when I type ./program and program is an ELF file. I grepped the bash-4.3.tar.gz, ...
1
vote
2answers
104 views

Using exec and tee to redirect logs to stdout and a log file in the same time [duplicate]

In a bash script, how can I redirect all standard outputs to a log file and tee the output on the screen using exec ? log_file="$HOME/logs/install.txt-`date +'%Y-%m-%d_%H-%M-%S'`" [ -f "$log_file" ] ...
3
votes
1answer
313 views

What does exec 3<&1 do?

I understand exec can do I/O Redirection on current shell level. but I only sees usage like exec 6<&0 # Link file descriptor #6 with stdin. # Saves stdin. exec 6>&1 # ...
0
votes
0answers
95 views

Gnuplot and process-substitution

I have a log file where I need to cut out two values at different positions. these are: time and dQ in my file. The main problem is the paste I think. cause the other utilities work pretty well on ...
1
vote
4answers
155 views

All subprocesses are Bash (!),

I was trying to use GDB, and found that whenever it attempted to spawn the program I was debugging, Bash was spawned instead (GDB would say starting myProg..., and then Bash would appear. When I ...
4
votes
2answers
2k views

Copy stdout and stderr to a log file and leave them on the console within the script itself

Using bash, how do I copy stderr and stdout to a log file and also leave them displayed on the console? I would like to do this within the script itself using an exec. I tried with exec ...
7
votes
4answers
1k views

redirect and log script output

I am trying to tidy up the following snippets, design goals are to log all output from a script, and should not be a wrapper. Less lines are better. I don't care about user inputs (at this stage), ...
3
votes
3answers
956 views

Find functions, commands, and builtins [duplicate]

Possible Duplicate: Executing user defined function in a find -exec call Suppose I have the following bash code: !#/bin/bash function print_echo (){ echo "This is print_echo Function" ...
0
votes
2answers
1k views

variables in find command and more shell problem [duplicate]

Possible Duplicate: Recursive rename files and directories I wrote the following script: #!/bin/bash SAVEIFS=$IFS alias export='export' IFS=$(echo -en "\n\b") find $1 -name "*" ...