Bash is a free shell for Unix-like operating systems from the GNU Project.

learn more… | top users | synonyms

0
votes
2answers
20 views

Bash Process output status

I would like to ask about creating new processes in bash script. I have script which will execute external programs tests and then check its output status and print if test was successful or not. ...
0
votes
1answer
40 views

Shell script force stop without waiting for the exit code

I have written a shell script checklick.sh on my CentOS box with the following content: #!/bin/sh # # description: check link through rtmpdump # . /etc/rc.d/init.d/functions ...
0
votes
3answers
44 views

How Can I Batch Change the Metadata of MP3 Files? [duplicate]

I have a fews of songs in a folder which I would like to add the metadata items of artist, title, genre and album to. I would like to take the metadata info for the title and artist from the file name ...
3
votes
1answer
42 views

How can I check if timezone has changed in a bash script?

I have a shell script that runs via crontab, but the commands in it are timezone dependent (they refresh a table in database everyday. If the script runs during the time of a DST change, it will ...
0
votes
1answer
26 views

Damaged preference file in /bin/sh

Today in Drive Genius 3, I ran the “Verify Preferences” function in Repair. It yielded this strange result: /bin/sh: xargs: command not found The only option Drive Genius gives is to remove the ...
1
vote
1answer
29 views

Want to create custom command and be able to pass arguments to it

So I have following command which I using pretty often on server ps aux | grep someword | awk '{print $2}' | xargs kill -9 What I want is make alias to this command and be able to pass arguments to ...
-2
votes
1answer
34 views

Bash executing command

Can anyone please give me the list generated by this : -{ for i in {1..100}; do lynx -dump -nonumbers -listonly [http]://www.dailymotion.com/user/MTDCafe/$i ...
1
vote
1answer
47 views

Dynamic variable substitution in PATH

I want to run different versions of Java on the same machine (Linux Mint 17) with default to Java 7. So I put this into /etc/environment: JAVA_HOME="/tools/java/java7" JAVA7_HOME="/tools/java/java7" ...
0
votes
0answers
33 views

Alternative ways of passing PS1 env variable into Ubuntu for SSH session

I know that there are twenty thousand answers, none of them worked as expected, I'm more surprised than you are, so please consider reading the story first. I'm trying to achieve what appears to be a ...
1
vote
0answers
38 views

PuttyCyg not starting correctly: “Must be connected to a terminal” error message

My computer is running Windows 7 SP1 64 bits with CygWin 64 bits installed and updated (as for 16-Nov-2014). I need to run the screen program of CygWin in a text console. I am trying PuttyCyg, a ...
1
vote
2answers
30 views

Shortcut to execute output of last command in Linux

Is there any shortcut to execute the output of the previous command, such as executing whatever is found by the locate command? For instance, if I run this locate command and get this output... ...
1
vote
2answers
46 views

Status line in linux shell

I use Windows and Putty in order to remotely connect (ssh) to some linux servers. I have set my hardstatus in my .screenrc file so that I can monitor some useful information. But this works only when ...
0
votes
1answer
27 views

Open file using bash with unix executable

I have an application which loads using a bash script e.g /Applications/My.app/Contents/MyExecutable I can load this using bash like so "/Applications/My.app/Contents/MyExecutable" However, I ...
1
vote
1answer
19 views

How to detect from a shellscript that a file on remote server has changed?

What could be used to detect that remote file is different compared to a local file? Possibly using ssh as a channel for communication. Scripted in bash, having linux servers in mind. This could be ...
0
votes
1answer
22 views

Difference between su and su -c (environment variables?) when running db2?

When I type this: su <user> -c "/home/<user>/sqllib/bin/db2 catalog tcpip node <dbName> remote <ip> server <port>" I get this error message: SQL10007N Message "-1390" ...
0
votes
1answer
67 views

Brew & Ruby no longer functioning properly due to a recursive trap

After updating to OS X 10.10 (Though this might have been irrelevant), I was not able to run any brew commands. Any command gave me this error: /usr/local/bin/brew: /usr/local/Library/brew.rb: ...
0
votes
0answers
9 views

rename using perl eval can mmv do this

Linux Mint 17 64-bit The following works to rename the numbering of files. # rename -n 's/(\d+)(.*)/($1+99).$2/e' *.txt 1-file.txt renamed as 100-file.txt 3-file.txt renamed as 102-file.txt ...
1
vote
1answer
23 views

Search for string and read the next line

I need to write a shell program that installs some packages. The program will run on Linux (obviously some commands will not work, for example, on Arch-based distros). So, I've got this file called ...
0
votes
0answers
19 views

Can I use ProxyCommand to run arbitrary commands on a target server via a jumpbox/middle server?

At work, we have a number of servers that we can only SSH into from our jumpbox server. Every now and then I need to execute a command on these servers. For example, if I want to execute df -H on ...
0
votes
1answer
34 views

Connect to PgSQL, DROP existent DB, recreate it using CREATE and run some queries alone and from files using Bash script

I need some advice creating a script for help me with repetitive task I do all the time on a development environment. I've a PostgreSQL server and since I'm developing a web application I need to ...
1
vote
1answer
36 views

Format terminal output to show apt-get upgrade errors in RED

I have a VERY simple bash script written for my Kali Linux distro so I don't have to run apt-get update, apt-get upgrade, apt-get dist-upgrade, apt-get autoclean, and apt-get autoremove every time I ...
-4
votes
1answer
27 views

Make a bash script sleep for x minutes [duplicate]

I need to make a bash script wait for a while, then resume running. Shebang ./script Wait 10m ./thing
0
votes
2answers
35 views

Bash - Fixing messy output

I'm not sure how/why this is happening. Basically I have a command that is supposed to find and clean out all files in the desktop that contain a certain pattern. I am doing the first part using: ...
1
vote
2answers
35 views

How to redirect stderr of python3 script using tee pipe?

I am a Debian and RedHat user. I would like to redirect stderr (module logging) from a Python3 script. The script outputs a lot of things and the part I want to capture can be fetched using: python3 ...
0
votes
2answers
32 views

Need help on if test condition

Need your help on below script where I am testing if file found at location /log/TestFile* and id there is only one file then it will display "File successfully Found" else "note found". my second ...
0
votes
1answer
32 views

processing sequential and parallel jobs in bash script

I understand that in bash programming, comamnd1;command2;command3 will run them sequentially while command1&&command2&&command3 will run them in parallel. However what happens when I ...
1
vote
0answers
31 views

Enter a Failed Docker Container with a Different Command

I have a fairly complicated docker container I'm attempting to build. As part of the build process I have I install Chef and have Chef install a number of cookbooks using Chef-Solo. I am having the ...
0
votes
0answers
34 views

Not able to open crontab -l

I am running crontab -l to view the crons on a RHEL server(v5.10) and getting the below error: crontab: error while loading shared libraries: libaudit.so.1: cannot open shared object file: No such ...
0
votes
0answers
18 views

Recursively create/update tarballs of old files inside directories

I have an archive directory of ftp files. I want to schedule a job to zip up any files that are older than 6mo into an tarball in each directory. I've started writing the script, but I feel like ...
-3
votes
1answer
21 views

linux software regarding filename

IN Raj's GNU/LINUX system there are a set of files and folders in his home dirctory (located in /home/raj). He wants to locate all pdf files which begin with the character sequence "lib" and contain ...
0
votes
1answer
45 views

Barnyard2 error on start

Been setting up a snort box with barnyard2, run into the error below. Can someone please help? $Starting Snort Output Processor (barnyard2): ./barnyard2: 35: ./barnyard2: barnyard2: not found ...
2
votes
3answers
97 views

How to open one GNU screen tab for each directory in a list

I have the following script - it sort of works. #!/bin/bash ... define plugins, etc for plugin in ${plugins[@]}; do screen -t $plugin done Want I want it to do open gnu-screen and for ...
2
votes
2answers
54 views

fit grep syntax from linux to solaris

The following command grep -w '^[^#]* machine_VIP' /etc/hosts | head -1 | awk '{print $1}' works fine on linux (its capture the machine_VIP alias and return the IP address from /etc/hosts and ...
4
votes
1answer
45 views

Tar using progress bar and handling multi-volumes

I'm trying to create a tar of a large LVM volume onto multiple external drives. That part is solved. Now, because it is a LONG process, I'd like a progress bar. From the excellent articles here, ...
1
vote
1answer
38 views

ffmpeg time lapse “overwrite” error - may be a globbing/shell issue?

I'm having some trouble with what I think should be a simple FFMPEG script. I'm just trying to take all the jpg files in a given directory and fill them into a time lapse video. I'm comfortable with ...
1
vote
1answer
34 views

Executing PHP file from command line with dynamic parameters

I need to run one script which will take one date as an argument. It is configured using cron to run on a daily basis, but I need to run it for a time range now. The issue is that this will fetch all ...
1
vote
1answer
42 views

How to make notify-send work on /etc/init.d/a_script

when i write notify-send 'test' in /etc/init.d/a_script, i can't see any notify. see following code: #!/bin/bash ### BEGIN INIT INFO # Provides: someone # Required-Start: $remote_fs $syslog # ...
2
votes
1answer
88 views

How can some output of `cat` change how unicode characters are interpreted in bash?

This is a question out of sheer curiosity: I have a custom PS1 setting in bash that is just the current directory, followed by a lowercase lambda (λ), e.g. ~λ. I accidentally used cat with a binary ...
1
vote
2answers
142 views

How to get the URL of Dropbox file from command line?

I would like to know if I can get the URL of a file to share in my Dropbox folder from command line. I would avoid to open the web browser every time.
0
votes
0answers
20 views

evilvte doesn't execute “su -c”

I have a script that must be run as root. I made a custom application launcher to launch this script, and the application launcher runs the code evilvte -e "su -c '/path/to/script.sh'". What happens ...
2
votes
1answer
45 views

In bash 4.3.27 “su” ignores user variables when combining “-” with “-c command”?

Since forever we used to launch user scripts from a different user crontab like this: 00 12 * * 1 su - user2 -c "/home/user2/myscript.sh" By doing this, the script is launched after the interactive ...
0
votes
1answer
75 views

How can I resolve the error “cannot execute binary file”? [duplicate]

I'm trying to test my installation for Pickit 2 on my Mac for the first time and when I put in: pk2cmd -?v I get: -bash: /usr/local/bin/pk2cmd: cannot execute binary file How do I resolve this ...
0
votes
1answer
54 views

How can I open a non-http URL (Chrome extension) in Google Chrome from the terminal in OS X?

I'm trying to add a shortcut to open Chrome with a non-http url from a bash script. This is what I've got: /usr/bin/open -a "/Applications/Google Chrome.app" ...
2
votes
1answer
81 views

Strange issue with upgrading bash in Yosemite using Homebrew

I'm running OS X Yosemite. I need to use associative arrays in bash so I decided to use Homebrew to upgrade bash to 4.x. I performed the following steps: brew install bash I then added ...
0
votes
0answers
32 views

linux bash/terminal emulator: key “q” not work

i am on debian, Xfce desktop env. When i press the "q" Key, there is no output on the terminal emulator screen/ bash standard output. The capital "Q" works. In vim the "q" works like every other ...
0
votes
0answers
8 views

Tab complete setsid

I regularly use setsid to open a program as a separate process, however it doesn't use tab completion so I end up writing the full program name. Is it possible to add tab completion to setsid? Has to ...
0
votes
1answer
22 views

How to remove characters in the middle of a string in bash

In bash I have a string, and I'm trying to remove a character in the middle of the string. I know we can remove characters from the beginning or the end of a string like this: myVar='YES' ...
0
votes
2answers
65 views

Parse out specific parameter from python script

I have a chage output that I formatted myself called accounts. It basically has the name of the user listed as a section and then the information below it (which are the parameters). I would like to ...
4
votes
1answer
168 views

Logging into hotel Wi-Fi changes bash prompt? [duplicate]

Since clicking on the “I agree” pop-up when logging into a hotel Wi-Fi, my bash prompt contains some kind of hash in it. The format is now: <strange hash>:<working dir> <username> ...
0
votes
1answer
37 views

Spell check in the Bash CLI

Is there any way to do a spell check on the Bash CLI? I tried doing Ctrl-X Ctrl-E to edit the command in VIM but for some reason I could not set set sp in that VIM session. I'm using Kubuntu 14.04.