Questions tagged [bash]

Bash is the Bourne Again SHell, the successor to the classic Unix sh (shell).

bash is the Bourne Again SHell, the successor to the classic Unix Bourne shell (sh). It's the default shell on many Linux distributions, including RedHat, CentOS, Debian, and Ubuntu.

The premier online guide is the BashGuide.

3527 questions
2
votes
1 answer

Bash Completion Script Help

So I'm just starting to learn about bash completion scripts, and I started to work on one for a tool I use all the time. First I built the script using a set list of options: _zf_comp() { local cur prev actions COMPREPLY=() …
inxilpro
  • 185
  • 2
  • 6
2
votes
6 answers

How to enter a bash script at the command line, but not process the script until the entire script has been entered

I am performing some interactive testing using HP's QuickTest Professional and Linux. I am connecting via SSH and feeding the BASH script lines directly into the command line. The problem I'm having is that the script executes as it is entered. I'm…
MHGL
  • 380
  • 1
  • 8
2
votes
3 answers

BASH Shell Scripting assistance, backup script extracts meta data from filename & moves file accordingly

So I need to build a shell script (a skill I am rubbish at, I think too linearly and make everything a pipe) that will connect to a remote machine to a specific directory slurp up all the files older than 5 minutes, extract information from the…
Nathan Milford
  • 792
  • 2
  • 10
  • 21
2
votes
6 answers

Linux script to kill process listening on a particular port

I have a process that listens on a TCP port (?0003). From time to time it crashes - badly. It stops working, but continues hogging the port for some time, so I can't even restart it. I'm looking to automate this. What I do right now is: netstat…
EMP
  • 5,172
  • 10
  • 37
  • 33
2
votes
3 answers

How do I set it so that everyone uses the /bin/bash shell?

It doesn't seem to work for some reason if I do this in /etc/profile: export SHELL="/bin/bash/"
Alex
  • 8,471
  • 26
  • 75
  • 99
2
votes
2 answers

Using CCZE with multiple log files

I am looking for a solution to watch live several logfiles on ccze. Currently I send a tail of each file in a pipe, this pipe is used by ccze for display all logfiles needed. The problem is that some log files are much more used than others, ccze…
anapivirtua
  • 71
  • 1
  • 5
2
votes
1 answer

How to get Ubuntu 9.10 Desktop system to automatically email it's IP address to a list on start-up?

The title question says it all. I've built a machine running Ubuntu 9.10 Desktop (AMD 64) and need it to email it's IP address to a list of email addresses whenever it starts up.
Michael Prescott
  • 655
  • 2
  • 9
  • 15
2
votes
1 answer

Binary won't execute when run with a path. Eg >./program won't work but >program works fine

I'm getting some weird behaviour for a binary file I'm trying to run. I'm using Mac OSX snow leopard, and the binary itself is part of labkey software .. built from source. If I try to run the file using an absolute path it won't work .. failing…
Ira Cooke
  • 123
  • 6
2
votes
2 answers

Best way to filter output by date range

I need to filter a row of a csv file by a date. The file is structured as so: test121smith@example.com active 01/24/11 10:04 07/23/23 16:56 test121johnson@example.com …
dj423
  • 23
  • 3
2
votes
1 answer

Start a VPN session using a Terminal script

I use an OSX Terminal session to start a VPN connection. The command that I execute at the prompt is: /etc/netlock/cvc -c :: This works as expected. I would like to save this to a script file that I can simply double-click to start. I created a…
craibuc
  • 467
  • 2
  • 5
  • 15
2
votes
0 answers

is there a shortcut for /dev/stdout like "-" is for /dev/stdin?

is there a bash shorcut for /dev/stdout like there is "-" for /dev/stdin ? One of the use cases is to get bash history without line numbers. There is simply no option for that in the history builtin. We can do 'history -w /dev/stdout'. But that's…
2
votes
1 answer

How to load modules on Synology NAS on boot?

I have a Synology NAS (DSM 6.2.4) and I would like to load usbserial.ko and cp210x.ko on boot. When I run: sudo insmod /lib/modules/usbserial.ko sudo insmod /lib/modules/cp210x.ko The drivers work correctly, but when I reboot they are no longer…
guttermonk
  • 151
  • 8
2
votes
1 answer

Is sudo -u username command the same as doing sudo -i -u username then command?

Is a terminal prompt sudo -u username command same as doing sudo -i -u username then command in the next line? If no, what is the differences? What are the use cases when doing the first is better or preferable than doing the later and vice…
joyoy
  • 21
  • 2
2
votes
1 answer

How to match only single . in file name and not two .?

In regex, I think I want .*\..* -> Match all files with any characters, single dot, all characters. In unix filenaming pattern matching, is there a way to do this as *.* matches filenames with two . in them. It will match release_4.18.1 file when I…
Dean Hiller
  • 911
  • 4
  • 15
  • 35
2
votes
4 answers

cron script for scheduled backups

i am looking for a cron script which can do some backups. im mostly a web developer so am kind of newbish with bash/cron stuff. i want cron will copy all the files or directories in a "filelist.txt" into a mounted network storage drive once per…
Will
  • 441
  • 5
  • 13