The shell is unix's command-line interface. You can type commands in a shell interactively, or write scripts to automate tasks. Use this tag for questions applying to /bin/sh and most compatible shells (ash, bash, ksh, zsh, …).

learn more… | top users | synonyms (1)

5
votes
1answer
142 views

Replace CD number in MP3 ID3 tag

I have a library of MP3 files where in some files the "CD number" tag (TPOS) contains "CDx" values, e.g. "CD1" or "CD2". The ID3 spec says that TPOS values shall be numerical strings. Processing these ...
3
votes
1answer
65 views

How to find all paths not compatible with Windows?

On most Linux filesystems, NUL (\0) is the only invalid character in paths (and / is reserved as the path separator). Windows has a complicated set of rules for valid paths. Rather than fixing paths ...
2
votes
1answer
68 views

Accumulate Filename in a Log file using shell script

I have files with their names as ABC_-_123321.20140505_-_161500.CSV ABC_-_654145.20140506_-_135020.CSV String_-_SerialID.Date_-_Time.CSV StartDate, StartTime, EndDate and EndTime are given as ...
2
votes
1answer
528 views

Gnome + Linux: GUI apps don't inherit PATH from parent console apps

In Gnome, don't GUI applications inherit the PATH of the shell process that launches them? Apparently, GUI applications see only the PATH specified in ~/.profile. No issues with console applications, ...
2
votes
1answer
407 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 ...
2
votes
1answer
385 views

KSH styling text based menu using STDERR

Is it possible to format the STDERR in order to have a better looking menu using the select command? I have a simple select select oChoice in $(<tempMenu.menu) ; do case "$oChoice" in ...
1
vote
1answer
17 views

svn: add all my new files and directories

I'm using Solaris 10. I need to add to SVN everything I've placed in the sub directories of my SVN checkout. I have added files and directories and sub directories - is there a command to take care of ...
1
vote
1answer
62 views

Prevent active file removal on an NFS filesystem

I clear my logs using following script - find "." -mtime 1 -type f -print0 | xargs -0 rm -rf But it deletes the active files also and creates .nfs… files instead. Is there any way to prevent ...
1
vote
1answer
26 views

check if genisoimage is succesful

I use a script to convert all VIDEO_TS directories to .ISO. How can I check if genisoimage is actually converting it instead of it failling and converting the next folder? After conversion I have a ...
1
vote
1answer
45 views

Pass login messages to tmux

When I login, I connect to a tmux session (either by exec'ing tmux if there is no current session, or exec'ing tmux attach if there is). However this means I don't see the login messages (/etc/issue, ...
1
vote
1answer
46 views

How can I add autocomplete for “gem which” with rbenv?

I am using rbenv on Mac OS X. I have autocomplete functionality already for the gem command: $ gem build environment lock query stale cert fetch ...
1
vote
1answer
105 views

set tab color in a tabbed terminal emulator

I would like to set in my terminal emulator (i.e. gnome-terminal) the color of the tabs like in the osx's terminal emulator. Is there this feature in any of the linux terminal emulator plethora? ...
1
vote
1answer
79 views

Program acting differently depending on user

I am trying to control an RC transmitter from a PHP site. The command works fine as user "xbian" in the command line: sudo /home/xbian/433Utils/RPi_utils/codesend 34832404 for example, and it works ...
1
vote
1answer
858 views

sh script will not execute as root (cron)

I have the following script added to cron. If I add touch thisisatest.file to the first line it will create a file named thisisatest.file, but not execute the rest of the code. If I manually type ...
1
vote
1answer
88 views

Autocompletion and coloring not working, when using ssh in emacs shell

I'm connecting to remote server using emacs shell. Emacs shell displays directory listings with proper coloring and auto completion when working with local machine. But when I use ssh the ...
1
vote
1answer
122 views

How to safely move a file to another directory and remove duplicates

I want to move files from Downloads, Documents, Pictures, Music, et al to shared locations. This is for various reasons, including because I want to keep media in a central, shared place. I want to ...
4
votes
0answers
53 views

Tracking my shell path in Emacs

Not a long time ago, I found the following precious snippet that allows Emacs to track my current directory on any ansi-term buffer. More specifically, if I cd <some/path> from within a ...
4
votes
0answers
82 views

weird output when typing letter c in shell (non english input)

I had keyboard set to Georgian language input. Forgot to switch it back to English and typed letter c in shell. c = ც english c key is mapped to georgian letter ც - if this makes any difference. ...
2
votes
0answers
158 views

How does SELinux / SEAndroid prevent or allow pseudo terminal allocation?

I'm trying to resolve an SSH connection issue on an Android phone running SELinux in "Enforcing" mode. The problem is that any SSH connection that tries to allocate a pseudo-terminal (/dev/pts etc) is ...
2
votes
0answers
101 views

zsh: Echoing every statement?

I have an odd problem with zsh when I switch between shells in a particular way: Option 1 (works well): I start a zsh shell. I switch to tcsh with /bin/tcsh, and I switch back to zsh with /bin/zsh ...
2
votes
0answers
275 views

What happens when you background a function which calls another function?

Question says it all on the tin. Can someone explain to me what goes on here ? I'm trying to find out how to background a process in a script that calls another function and reliably terminate it when ...
1
vote
0answers
70 views

Measuring context switches of a LWP gives incorrect results. Why?

I have a Java thread pinned at my cpu core. It is busy spinning and I see through top that it is running fine: %Cpu0 : 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu1 : ...
1
vote
0answers
28 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
49 views

Merge several files with maximum 1 line difference

Suppose I have the following files: file0.c: int b=NULL; int a=NULL; file1.c: int b; int a=NULL; file2.c: int b; int a=NULL; I am looking to merge the files file1 and file2 to generate the ...
1
vote
0answers
59 views

Segmentation fault with dialog

I'm getting a segmentation fault with the following script when it's more that one child dir past the pwd. The program kills with the error message and I have to reset the shell. For example: I start ...
1
vote
0answers
308 views

Using node.js and shelljs as interactive shell

Following the answer given at unix.stackexchange.com/questions/58011/is-there-a-javascript-shell That requires me to always execute var shell=require("/usr/local/lib/node_modules/shelljs"); It ...
1
vote
0answers
146 views

Serial Communication on DD-WRT stty config not sticking

I am attempting to control a serial device (in this case a projector) using a Fonera router with DD-WRT on it. I've got the serial port on the fonera wired through a level shifter and then into my ...
1
vote
0answers
212 views

gnome-terminal cmd leaving processes open after closing parent window

The following simple command should demonstrate my issue: gnome-terminal --tab -t "Tab 1" -e "/bin/bash" --tab -t "Tab 2" -e "/bin/bash" This should open a new window with two tabs and an active ...
1
vote
0answers
211 views

service command: Failed to issue method call

I downloaded the source of tinyproxy and then use ./configure make make install to install it Then I want to start it, but get errors, like the following: [root@kitty tinyproxy-1.8.3]# service ...
1
vote
0answers
52 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 ...
1
vote
0answers
30 views

Make zkbd ignore $DISPLAY

Is it possible to make zkbd ignore $DISPLAY variable? I have set up when I log in to different X sessions and it is annoying if suddenly I need to reenter/copy configuration (and I have no idea why ...
1
vote
0answers
117 views

(KDE or X ) Script opens konsole in wrong virtual desktop

I have this script. I put it in ~/Desktop. I view the script on my desktop in a "Folder View" widget. When I click on the script, I get list of users, then I get an authorization dialog box ( for a ...
1
vote
0answers
384 views

Manually setting environment variables for Metasploit

How do I set manually environment variables for Metasploit, when I execute db_driver I get this message: [*] No Active Driver [*] Available: [*] DB Support: Enable the postgresql driver ...
0
votes
0answers
10 views

Chrome OS: Crosh Window and Hostname

I have a couple of questions regarding Chrome OS: By default Ctrl+Alt+T opens a crosh window within the Chrome browser. I have the Crosh Window extension, which I would like Ctrl+Alt+T bound to - ...
0
votes
0answers
22 views

How to return multiple select count in an array variable in shell

I have a 4 SQL count values which I want to return in an array record_count so that I can use that count values in some if statements later in the shell program. But I am not able to return the values ...
0
votes
0answers
24 views

Virtual serial port problem

Background: I've to test external GSM module, connected to PC with serial port. Since I'll have to either send messages both to do more, I need to create two virtual serial port (script provided by ...
0
votes
0answers
27 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 ...
0
votes
0answers
41 views

Specific Jar file doesn't run on startup

I want to run a jar at startup, so I asked a question here. I was given a few suggestions, so I started from trying to create a script file and desktop file. I created a script file and desktop file ...
0
votes
0answers
27 views

convert many eps files in a single pdf or ps file using shell scriptI

I have SSt12.OLR.1.eps, SSt12.OLR.2.eps SSt12.OLR.3.eps SSt12.OLR.4.eps ......and covert these eps files into single pdf or post script file. please suggest a shell script.
0
votes
0answers
50 views

How to format xml attributes, not just elements

How do you format an XML document to make it easy to read element attributes? I have a xml based webservice that returns one or two elements, but with hundreds of attributes. As I'm doing ...
0
votes
0answers
21 views

Convert rgba color value to a Terminal supported color

Randomly I will take the following example: rgba(122, 143, 186, 0.54) How can I convert this color to the closest Terminal supported color?
0
votes
0answers
61 views

usermod -L after creating the home dir

so I see from some questions here, to lock an account, create it, then lock, e.g. useradd -M lol;usermod -L lol However.. I do have a home dir, by eg. useradd -md /path/lol Question is.. to avoid ...
0
votes
0answers
202 views

Override LDAP login shell for a specific user in RHEL

How in RHEL do I specify /sbin/nologin shell to limit a user to SFTP access only when their shell is determined by their LDAP profile? chsh only works with passwd file users I believe.
0
votes
0answers
73 views

Application does not see environmental variables

I am running following 32 bit command on 64 bit system: LIBGL_DEBUG=verbose glxinfo32 -v -t | head -5 It's output says direct rendering: No (If you want to find out why, try setting ...
0
votes
0answers
120 views

Do all Debian-based distributions come with the same default .bashrc?

I ask this out of curiosity because while I have kept my system configuration files under version control for some time now, they've only ever been for OS X. Recently, though, I've been developing ...
0
votes
0answers
169 views

init-scripts in autoyast to autodeploy Suse Linux server

I'm deploying a base SLES11.1 server using autoyast. What I want to achieve is to install some packages on it after the deployment. So I use the init-script in the autoyast control file. Here is the ...
0
votes
0answers
256 views

Easy way to push data into MongoDB from Bash shell script?

I know you can create a Javascript file that the MongoDB shell will execute upon startup. But I'm hoping for something more "lightweight" than that. I am using a Linux program that has a scripting ...
0
votes
0answers
121 views

How do I make www-data run vim command (and find plugins)

I use the vimwiki plugin for note taking, and for those rare cases when I can't reach my home server over ssh, I use a simple html-form to update the textfiles. In vimwiki there is a command to export ...
0
votes
0answers
81 views

unexpected bash behaviour after console login (openSUSE)

I'm trying to install a Linux OS on the computer I use as a home server, because I liked "Raspbian" so much on my Raspberry Pi. I created a custom linux using openSUSE Studio, that's just text based ...
0
votes
0answers
242 views

python error using an executable with Z shell

I'm getting this error from the Unix Z shell (I'm on Mac): python: posix_spawn: /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python: No such file or ...