Questions about shell scripts, executable files that are interpreted by a shell (bash, zsh, etc.).

learn more… | top users | synonyms (2)

3
votes
0answers
18 views

Get notified from avahi

After looking for a zero-conf browser valid implementation I realised that inside my linux machine (ubuntu) I already have avahi and typing: avahi-browse -alr I get a complete list of all devices ...
3
votes
0answers
77 views

Understanding line numbers reported when using eval

Okay, so I'm stuck working with a shell script that needs to use eval (I know, I know, ultimate evil etc…) however I'm having difficulty debugging some of the line numbers being thrown out by errors. ...
2
votes
0answers
12 views

unbuffer/expect swallows the rcode when its child is signaled

unbuffer is able to pass along the return code of a process under normal circumstance, but if the process you are unbuffering is killed, for instance with a segfault, I see $? as 0 while I expect 139. ...
2
votes
0answers
76 views

How to write a shell script to run multiple command in different screen sessions?

My goal is to write a zsh script in order to create multiple screen sessions and run separate commands on each of them. I would also like to check at the beginning of my script if there are any ...
2
votes
0answers
33 views

background gui process in shell script

In the below script, ivfstudio commands open a gui. Even launched as a background process, I need to close it first so that the next commands are executed. How to make it "really background" ? ...
2
votes
0answers
101 views

Running shell script inside with vagrant provision

I have setup a vagrant box using precise64 (ubuntu 14.04) and installed packages needed for octopress. I can ssh into the vagrant box and generate posts and run preview for my octopress site. Now I ...
2
votes
0answers
37 views

Shell scripts for the database logs

The actual log file will be like this $ cat file1.log time=2014-07-23 23:56:28 GMT, user=[unknown], db=[unknown], host= pid=28254 LOG: time=2014-07-23 23:56:28 GMT, user=portalman, db=ss, ...
2
votes
0answers
99 views

Securing a script a little more

I currently have the following script which works fine: #!/bin/sh user="$(zenity --entry --title="Username" --text="Username")" pass="$(zenity --password --title="Password" --text="Password")" ...
2
votes
0answers
42 views

Scripts cannot run simultaneously on startup

I want two scripts (Server_drive, Server_video_boot) running on startup, but there is conflict between them. Specifically, there is always running the script with the lower priority. I tried with many ...
2
votes
0answers
70 views

Creating multicast join for tcpdump captures

I want to write a linux shell script which will capture specific multicast traffic. Specific as in, I want to create a pcap file that has all the traffic for one specific multicast group/port. Here ...
2
votes
0answers
78 views

Why is my inotifywait loop exiting after removing some subdirectories?

i have the following bash script: #!/bin/sh dir1=/source/dir/path/ while inotifywait -qqre modify "$dir1"; do rm -r /destination/dir/path find /source/dir/path/ -name .svn -exec rm -rf '{}' \; ...
2
votes
0answers
236 views

Number comparisons in BusyBox ash

I have the following script that extracts data from the EXIF command on my BusyBox ash-based system. I parse the date tag from the end of the file and use case as a final check to ensure the format ...
2
votes
0answers
125 views

Check via Shell-script if server currently streams via dlna

Currently I'm running uShare to stream videos from my home-server via DLNA to the TV. On the server there is also running a bash-script which checks if a user is connected via ssh or Samba. If this is ...
2
votes
0answers
827 views

Script stops command in it with exit 0

When I write a bash script similar to this on RHEL 6, if [ "$2" = "" ] ; then echo vip.start: ERROR: no NIC specified echo vip.start: Need IP and base interface name exit 1 fi case "$1" ...
2
votes
0answers
404 views

Validate Password for user account from shell script

Application is for a multiple server standardization script Looking for a way in a shell script to check if the password for an OS account (AIX) matches a standardized plain text password. The ...
1
vote
0answers
21 views

Run startx & automatically embedded syste,

I am working with a board in which I run my application which use th graphical mode. Everything works perfect. I start the graphical mode like this: startx & and then I run my application like ...
1
vote
0answers
41 views

When gnu parallel exit,my program also fail

I use gnu parallel to run a bash function. The function just contains the bash script to restart my program. At first, the restart is ok, but when the gnu parallel script exits, my program also fails. ...
1
vote
0answers
62 views

How to properly start and stop shell script in linux, busybox?

I am trying to write a small shell script that would send some commands to my tv set from my set top box that has busybox on it. The problem is that it generates huge amount of zombie processes, and ...
1
vote
0answers
27 views

Trap not trapping SIGTSTP

I have a script that keeps displaying the login prompt: #!/bin/bash trap '' 2 20 while true; do login done This is part of a bigger project so please don't tell me to just use the system login ...
1
vote
0answers
8 views

Automating minisat solutions

I'm a unix noob and need a simple (bash) script. I am solving SAT instances using minisat. The syntax is minisat inputfile outputfile. However, it only returns one solution. To find all solutions I ...
1
vote
0answers
14 views

FFMPEG stream won't show up on Justin.tv

INRES="1366x768" # input resolution OUTRES="1366x768" # Output resolution FPS="35" ...
1
vote
0answers
26 views

Open to specific gvim tabs

I have a working environment that I'd like to save via a script. -EDIT: I don't need to save it's state, I just want my script to define it. Though saving state would work too I guess. Currently it ...
1
vote
0answers
61 views

Changing KDE's mouse theme and buttons settings from a shell script

I'm trying left handed mousing, and I want to be able to easily switch between right handed mode and left handed mode. There is a utility for Windows called SwapMouseButtons that allows to bind a key ...
1
vote
0answers
60 views

Cron job running but not establishing tunnel

I have a script which establishes a reverse tunnel on an endpoint HostB. It looks like this: cat tun.sh #!/usr/bin/env bash # Test code /usr/bin/ssh -V 1> /home/userA/bin/tun.stdout 2> ...
1
vote
0answers
36 views

Execute commands on TMUX Detach

Is it possible to execute commands on tmux detach? I usually have a rails console and server running in the tmux session, on detach is it possible to automatically end those? Thanks.
1
vote
0answers
51 views

Running a script after tty1 has loaded

I have been attempting to write a script to run dcled on start up, the program that runs this. I am using Debian Jessie with multiarch enabled. This is essentially a small file server. I am ...
1
vote
0answers
68 views

Better approach to generating and adding contents to files

I have an input file like below. 1 First one 2 First two 3 First three 3 Second three I am generating 2 output files like below. #FILE1 1 First one 2 First two 3 First three #FILE2 1 ...
1
vote
0answers
47 views

manipulate a Drush “internal” variable

I want to modify a variable (preferably in a Bash Script format) because my PHP environment requires a port number. To show a URL in Drush containing a token that logs you in as user 1 (without a ...
1
vote
0answers
39 views

List Mails by subject

I'm writing a script to send mails from a mailbox on a remote server and a script to check if the mails are received at another remote server. For this I have configured mutt. What I now need is to ...
1
vote
0answers
173 views

Shell script to backup VMware VM's, exporting each VM to a list then asking user intput

What I'm Trying To Accomplish: Get list of Virtual Machines ".vmx" file and place in variables Give the user and choice of which VM to backup Use "ovftool" to produce an export of the chosen VM to ...
1
vote
0answers
112 views

Intercepting packets with bash

I'm wondering if it's possible to detect a packet that comes from certain IP and port(suppose IP 1.1.1.1 and port 80) and has some specific information on it (suppose "<h1>Web ...
1
vote
0answers
74 views

how to list blocked connections events by the firewall?

So, I used firestarter that had logged blocked connections events with some useful details (but it is not being updated and I found somewhat unsafe as any moment we could click to deactivate the ...
1
vote
0answers
1k views

Using sshpass, return code (exit status) differs for reasons unknown using valid commands

There are a few things going on here but I think ultimately, either CLish or SSH is returning an exit code that is messing up my work flow. I'm attempting to connect to a remote machine (CLish shell) ...
1
vote
0answers
205 views

how to create a script to backup MySQL databases on separate files?

I need to create a script so to automate the backup process for my database server. Today there are 19 databases on the server and to prevent some schema is created and not contemplated by the script, ...
1
vote
0answers
781 views

rc.local not being executed when os boots up

I have a script that needs to be run when os boots up. I added it to /etc/rc.local. It was working fine for sometime but now rc.local does not load at boot time. When i checked the permissions on the ...
1
vote
0answers
84 views

How to make tcsh not insert whitespace in a command that spans multiple lines

Bash does not seem to insert whitespace but tcsh does. Tcsh bash-3.2.25$ tcsh -c 'echo $tcsh; echo A\ > B' 6.14.00 A B Bash bash-3.2.25$ bash -c 'echo A\ > B' AB How can I ask tcsh to not insert ...
0
votes
0answers
21 views

Bash script for opening screens and compiling the same file

I have written a bash script to initiate separate screen sessions and run a command in each of them that compiles the same C++ source file in ROOT (an object-oriented data analysis framework ...
0
votes
0answers
6 views

How to use scanner drivers api in Linux shell script

Usually when scanning any page using Canon DR- 2050C scanner in windows it rotates vertical text paged to horizontal automatically for the easy reading of the user. In Linux we are manually scanning ...
0
votes
0answers
16 views

Run Xserver as root

I am working with an ARMStone a9 board which has iMX6 linux kernel. I am doing an embedded application in which I have to show a video from Ipcamera. The thing is that I attached the screen to my ...
0
votes
0answers
23 views

get time of file in inotifywait tool

for this script: inotifywait -m /path -e create -e moved_to | while read path action file; do echo "The file '$file' appeared in directory '$path' via '$action'" # do something with the ...
0
votes
0answers
16 views

AWS EMR Bootstrap

I need to write a bootstrap action file for my AWS EMR that runs during provisioning and performs: Install latest R version from: http://cran.us.r-project.org Install ‘lme4’ package (and all of its ...
0
votes
0answers
13 views

Mutt multi content type

Good afternoon I want to send multiple content_type with mutt. Can I do that? Here is my code : mutt -e "set content_type=text/html" -e "set content_type=text/plain" someone@mail.com -s "Multi ...
0
votes
0answers
23 views

authenticate url with asked credentials

there is a URL http://server, when I open this url it ask for username and password (.htaccess authentication), this URL works fine in browser. This is the webpage not the browser which ask ...
0
votes
0answers
37 views

Updating data sets from Online databases/Webservice

I want to have an idea as to how to update the data regularly from the source, if its stored locally in your server or local machine.Lets say MySQL database. Source:It will be a webservice data ...
0
votes
0answers
49 views

Connect Unix and Windows using shell script

SRCDIR="source/directory" TMPDIR="temp/directory" [ ! -d "$TMPDIR" ] && mkdir -p "$TMPDIR" for file in `find "$SRCDIR" -ctime -1 -type f -name "abc*pdf*"`; do cp $file $TMPDIR done cd ...
0
votes
0answers
23 views

How to capture INFORMIX DB errors in shell script?

I need to capture the informix DB errors like Update failed, Insert failed using the shell script. I am using ksh shell.
0
votes
0answers
82 views

How to find the cpu and memory usage of a single process in linux

This question is similar to this SO. I wanted to find the CPU and memory utilization for a single process so I decided to use the top -p <$PID> as mentioned in the question. Here is my script. ...
0
votes
0answers
24 views

A script to identify whether a file descriptor has gone bad

Problem : I have a server program running which connects to a remote program using TCP sockets. There many of them (say 20). My problem is one of the socket descriptor has gone bad and has recieved ...
0
votes
0answers
63 views

Find if the file is compressed or not

I need to find whether the file is compressed or not in script.If it is compressed I need to uncompress and send as attachement. My find command results in two files sum12.pdf.Z and sum23.pdf.Z My ...
0
votes
0answers
29 views

shell script for executing mux verilog code

I have a verilog file mux.v and testbench muxTB.v. used ifdef caeses for behavioural model ifdef struct for structural model I have executed these files using the commands iverilog mux.v muxTB.v -D ...