1
vote
1answer
26 views

Save views in multiple screen terminals

As I do in default single view screen terminal of ubuntu; gnome-terminal \ --tab-with-profile=Default --working-directory="some dir" --title="some title" \ --tab-with-profile=Default ...
1
vote
1answer
112 views

What Causes Maintenance Shell Segmentation Fault?

I'm running Ubuntu 14.04 Trusty Tahr in a Microsoft Hyper-V virtual machine on Windows Server 2012 R2. I've stopped the VM, replaced an EXT4-formatted virtual disk volume (/dev/sdb) with a new ...
7
votes
1answer
81 views

How do I use colors in the MOTD?

I edited the default /etc/update-motd.d/00-header, adding some color to make it easier to read: printf "Welcome to \e[1;34m%s\e[0m \e[2m(%s %s %s)\e[0m\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" ...
0
votes
0answers
31 views

Use FindBugs in Eclipse from terminal on Ubuntu

Is there any way I could use Findbugs from terminal to get all the bugs in my Java code and print it out to a text file? I want to write a script that goes through 100 java files ( this is already ...
1
vote
1answer
97 views

upstart writing to syslog in a simple way

I have an upstart script that uses pre-start script exec >/dev/kmsg 2>&1 echo starting program # run my program here npm install node app.js end script to redirect output of a ...
4
votes
1answer
61 views

heuristically find how different a set of files are

I am having a large number of output files produced by repeated runs of a test suite and would like to see, approximately, how different they are. Ideally they should all be identical (indicating a ...
1
vote
1answer
78 views

How to check for a folder inside a particular folder in shell script?

I am working on a shell script and python script as well. Python script is passing certain parameters to my shell script and then I am using those parameters in my shell script. Below is my shell ...
2
votes
2answers
54 views

git diff - listen for key press

I want to run the following commands: git diff git commit git commit will open the default editor to edit the commit message. But if the difference if not too long it will close immediately. How ...
1
vote
1answer
365 views

Not able to copy multiple files using rsync 3.0.9 version?

I am trying to copy two files using rsync from a machineB but somehow it always copies only one file but not the second file - Here is the syntax I am using - rsync -avz ...
2
votes
3answers
394 views

How to use rsync or scp to efficiently copy the files from machineB and machineC to machineA?

I am running my shell script on machineA which copies the files from machineB and machineC to machineA. If the file is not there in machineB, then it should be there in machineC for sure. So I will ...
2
votes
4answers
452 views

What are SSH_TTY and SSH_CONNECTION?

What are the SSH_TTY and SSH_CONNECTION variables for? On my Ubuntu system both of them are blank; what values should they have?
-4
votes
3answers
3k views

How to get IP Address using shell script? [duplicate]

Want to get the IP address using Shell script. Without knowing the eth0 or eth1 or eth2 How to get the particular IP address. I am not interest to get localhost address, want to get private IP ...
-2
votes
2answers
744 views

how to execute a python program in a shell script

I have a python program in that I wrote some python code (disk.py). I executed this program using the command python disk.py in a terminal, it worked. Now I want to execute it using a shell script.
0
votes
1answer
83 views

What distribution do you suggest for daily use? [closed]

I use my computer everyday for various reasons: programming in c++, android(java), java(in general) listening to music(spotify), watching movies browsing internet, watching youtube clips writing ...
0
votes
1answer
344 views

How to write conditional if statement in bash shell script?

I have a below shell script which will get the latest folder from my current directory in machineB and machineC. So I came up with the below command which will find me the latest folder inside - ...
2
votes
2answers
103 views

How to cd into a directory as part of shell script and do a word count of files?

I am trying to get the latest folder inside my directory in machineB and machineC. So I came up with the below command which will find me the latest folder inside - `/bat/data/snapshot` And that ...
1
vote
1answer
42 views

Cannot figure out how to revert back to backed up profile file

Basically, I made a backup copy of my /etc/profile (or ~/.profile I can't remember exactly) file that executes as soon as you login to a TTY, and then I changed the one that was there, and now it ...
1
vote
1answer
506 views

Cron automated bash script to run run 1 bash script then another, plus integrity check

So I have a custom in-house app developed by a 3rd party. When the app is running, I can verify it is running with the "screen -ls" command. As long as screens are running for rails and freeswitch ...
1
vote
1answer
107 views

How to know I am using vi or emacs input?

Crash shell allows to specify the command line editing mode to vi or emacs. What will be the difference in these input methods? I am not asking about the internal features.
1
vote
0answers
55 views

add audio from playing file to microphone stream

I need to add a sound to what the microphone is capturing, is it possible? I started with man aplay and found that I can do aplay -D PCMdevice filepath.wav so then I listed the PCM devices with ...
2
votes
1answer
169 views

Creating a terminal application from a shell script

I have a shell script. I want to convert the shell script to an application for Ubuntu which can be installed using (sudo apt-get install) command and after installing, the application can run from ...
2
votes
1answer
163 views

What can cause a .sh file to not launch through this type of install?

I am using an Ubuntu 12.10/Gnome3 and was setting up PhpStorm using this tutorial http://devnet.jetbrains.com/thread/439389 The process involved copy/pasting the files into usr/local/PhpStorm-** (with ...
10
votes
6answers
7k views

How can I switch between different audio output hardware using the shell?

I use my laptop with an external monitor which has speakers. When the monitor is attached through HDMI I can switch (using the GUI: Sound Setting --> Hardware) between the normal laptop audio output ...
2
votes
2answers
107 views

Are any files loaded when a terminal session terminates?

I know that .profile / .bash_profile are loaded when a terminal session is started, either through local machine or SSH. Are there any files that are loaded/called when the session terminates? ...
2
votes
1answer
761 views

“[sdc] Assuming drive cache: write through” Need to hide this message!

When you plug an external drive into my Ubuntu server this message pops up "[sdc] Assuming drive cache: write through"... I would really like it so it stops sending it to the screen. Any ideas on how ...
2
votes
1answer
476 views

Execution time of pi calculation in shell scripts

I have to run a couple of command lines on a shell script on Ubuntu, one of those is a pi calculation. It works fine when i run it on terminal via the following cmd line: time echo ...
2
votes
1answer
424 views

Xubuntu 12.04: slow login

I'm running Xubuntu 12.04, and after I ran the update, my login started slowing down big time. I've dabbled a little bit with the programs in Settings -> Settings Manager -> Session and Startup, and ...
12
votes
3answers
20k views

Shell script fails: Syntax error: “(” unexpected

I've been working on a script that automates setting up a development environment for Raspberry Pi development (step by step details that work are here). The script is linked in that article but ...
4
votes
3answers
8k views

Automating textual input from a bash script without using EOF

I'm running Ubuntu Linux. Suppose there is a program called myprogram. This program prompts the user for input; specifically, the user must type an integer when prompted and press Enter. I would ...
2
votes
4answers
2k views

Change password in headless mode

I am building a script to fully automate a VPS setup, and I need to change the root password. I would like to avoid typing it as the script is running through SSH. Is there a way to redirect an ...
-1
votes
2answers
3k views

clear tmpfs in my case

I am on a Ubuntu machine. I have make a directory under root directory, by: $ sudo mkdir /hello $ sudo mkdir /hello/bye Then I mount tmpfs with size 1024M to /hello/bye by: $ sudo echo "tmpfs ...
1
vote
3answers
144 views

Transferring access privileges from root to regular user

I log in to Ubuntu with the username student. There are some directories only the root user is allowed to access, for example /var/lib/mysql, (I know I can use sudo to access it but it is not what I ...
2
votes
2answers
398 views

How to execute script on logging out?

I'm reading The Unix Programming Environment. There is an exercise question to print how much CPU time you have consumed when you log off by editing .profile. I tried with this trap 'times' 0 1 2 15 ...
12
votes
3answers
3k views

Why don't my arrow keys work in sh?

I recently installed Ubuntu and when I run sh on the Terminal my arrow keys don't work so I can't go through my call history or edit whatever I'm typing. It just comes out as weird characters like ...
4
votes
2answers
372 views

Should I be using 'sudo' in scripts that I write?

I'm setting up a new machine (well actually, an Ubuntu VM) and am trying to write a script to setup a few common things that I use when doing this (Git, curl, vim + janus). So my script looks a bit ...
1
vote
0answers
95 views

Seeking command-line example for adding images to MP3 files [duplicate]

Possible Duplicate: Searching for a command line tagging tool for mp3 and ogg that supports pictures Anyone have a command-line example illustrating how to properly embed an image (for ...
1
vote
1answer
180 views

Return Carriage not working (Screen)

When I execute the command screen -S myscreen -X stuff $'search add $1 \015' from a shell it works perfectly. If I put it in a .sh file and run it as sh /test.sh variablehere it sends it to screen as ...
5
votes
1answer
815 views

How to determine if disk is compact flash or standard hard drive

I need to determine in a shell script if a given block device (e.g. /dev/sda) is a compact flash disk or a regular hard drive. Google did not help me out for once, and while udevadm info --query=all ...
0
votes
4answers
2k views

Copy a directory to external HDD

I'm trying to copy a directory to external HDD- i mounted the device and then typed : cd root tar -cf - * | (cd /mnt ; tar -xpf -) I got this error message: "cowardly refusing to create an empty ...
19
votes
4answers
13k views

How can I play a sound when script execution is ready?

I am executing every now and then some python scripts which take quite long to execute. I execute them like this: $ time python MyScript.py How can I play a sound as soon as the execution of the ...
5
votes
1answer
727 views

Why root's default shell is configured differently with other normal user account's default shell?

As I know, root's default shell is configured csh and normal user's default shell is sh in FreeBSD. And in Ubuntu, root is dash, normal user is bash. (refer: What's the Ubuntu's default shell?) Why ...
17
votes
3answers
6k views

bulk rename (or correctly display) files with special characters

I have a bunch of directories and subdirectories that contain files with special characters, like this file: robbie@phil:~$ ls test�sktest.txt test?sktest.txt Find reveals an escape sequence: ...
49
votes
13answers
41k views

How can I get distribution name and version number in a simple shell script?

I'm working on a simple bash script that should be able to run on Ubuntu and CentOS distributions (support for Debian and Fedora/RHEL would be a plus) and I need to know the name and version of the ...
2
votes
4answers
2k views

Shell script error message

I am trying to learn shell scripting by reading linuxcommand.org. For some reason I keep getting the error "Not Found", even though it runs all the commands. The error codes I get are: ...