A shell is software that lets users interact with the operating system, usually by typing at a command-line.

learn more… | top users | synonyms

2
votes
1answer
381 views

Echo string in tcsh with special characters escaped

Is it possible to echo out a string in tcsh such that it is fully escaped, as tcsh would understand? In the same way as printf %q works in bash: % # Create a variable containing a tab character % ...
2
votes
1answer
674 views

SSH Session Started from Here Doc Does Not Exit Properly

SSH session doesn't terminate and give the tty back when executed inside a here document. Below is the code snippet that's inside my shell script: ssh -t -t root@$HOST_ADDRESS <<TERM_STRING cd ...
2
votes
1answer
78 views

Set timeout on zsh autocompletion

I like ZSH's autocompletion feature, but often it hangs my terminal. I'd like to set timeout on autocompletion so it cancels (kills) itself after n miliseconds.
2
votes
1answer
2k views

Cygwin runtime errors (“couldn't allocate cygwin heap”)

I am getting following exceptions when I start running some commands in Cygwin. C:\cygwin\bin\bash.exe (4136): *** couldn't allocate cygwin heap, Win32 error 0, base 0x740000, top 0x755000, ...
2
votes
1answer
996 views

Tab Auto-Completion in Mac OS X when using sftp in terminal

i have been getting very frustrated lately since the readline functionality has been removed from MacOSX and Tab Auto-Completion doesn't work anymore. So i was wondering if anyone knew a good ...
2
votes
1answer
685 views

Replace bash shell with python program's cmdline interface

I have a program which uses python's cmd module for command line interfaces. Now I want it to run on my Linux server whenever any normal user logs in to it, in a way that user never gets the default ...
2
votes
1answer
466 views

Messy output in zsh working in emacs M-x shell

I have changed my shell to oh-my-zsh, which is working great in iTerm. However when I open up my Emacs, M-x shell, I see it also changes to zsh, but the output from executing commands is messy: ➜ ...
1
vote
1answer
17 views

Custom Windows shell hosted on the network

We have a custom kiosk-style executable that we are using as a shell on Windows 8.1 machines. We'd like to host it on the network so that it's easy to update as desired. The problem we have is that ...
1
vote
1answer
26 views

Can't find the good Cygwin shell executable

I am working on Windows 7 and I need Cygwin for my project. I am trying to launch the Cygwin terminal from a Java programm and then write command lines but my problem is that I can't find the right ...
1
vote
1answer
21 views

Shell Script unable to execute passed command as input

I am trying to execute command from script but unable to execute it. script :command.sh #!/bin/bash a=$1 b=$2 echo "a=$a" echo "b=$b" `$a | $b` Execution command : bash-3.2$ ./command.sh "tar ...
1
vote
1answer
23 views

How to create filename.tar.Z file on SunOS operatting system

I am trying to create filename.tar.Z file using single command on SunOS but it doesn’t seem to work: bash-3.2$ tar c DIR | compress >DIR.tar.Z tar: /dev/rmt/0: Permission denied bash-3.2$ Other ...
1
vote
1answer
76 views

Linux unzip: don't prompt user

I need to unzip a file in my nodejs script: var exec = require('child_process').exec; var execOptions = { timeout: 15000 }; exec('bash unzip.sh', execOptions, function (error) { ... }); In ...
1
vote
1answer
89 views

WinRar - Custom shell commands

i'm trying to create custom commands on the context menu in windows. i found this great registry hack here: https://superuser.com/a/376879/395548 this is the code made to work for me: Windows ...
1
vote
1answer
56 views

Tar not preserving permissions on extract

I'm backing up a users folder as root using tar tar -czf /mnt/disk/cloud.tar.gz -C /home/cloud/ . In /mnt/disk I do a test tar ztvf cloud.tar.gz and it shows -rw-r--r-- cloud/cloud 14 ...
1
vote
1answer
319 views

What is the difference between set, env, declare and export when setting a variable in Linux shell?

What is the difference between set, env, declare and export when setting a variable in Linux shell, like Bash?
1
vote
1answer
38 views

Different globbing behavior with same shopts?

I have multiple shells (bash) open on the same machine, and in one of them, globbing seems to have stopped. ls * gives ls: *: No such file or directory, and so on. I figured that I must have set some ...
1
vote
1answer
55 views

realpath (GNU coreutils 8.22) does resolve “.” symlink regardless of “-s”

I'm trying to use realpath in a script which has to ensure that it is located under a certain (possibly symlinked) path. Also the script has to be runnable from any location, so it cannot presume that ...
1
vote
1answer
31 views

Is it possible to sed -i from a text file to another text file?

I'm coding a shell script on my Debian box and there's a line on the script that needs to delete some emails from a textfile that is full of emails, like this: sed -i ...
1
vote
1answer
122 views

error handling in case sentences [Shell Script]

I have this setup and I need when an error happened in the main script, to take this error to a $INFO_PLUGIN temp file, the problem is the script continues working after case and send also an OK ...
1
vote
1answer
22 views

Forwarding shell to servers without installing it

is there any way how to forward a shell to a server without installing it on that box? This is what I need to do: I work for company where we admin X boxes and I will probably not be allowed to ...
1
vote
1answer
25 views

Building a String of dynamic length - least consuming way?

I want to write a series of the character -, the amount equaling to 50% of the terminal window column size. I already have the column size. Let's say the terminal column size is 30. My desired end ...
1
vote
1answer
405 views

Sending Linux commands over serial connection to an Android device

I have a question about being able to send Linux commands over a serial connection to an Android device. I have heard of PuTTY and tried to use it, but I am ultimately lost with it. I was in the ...
1
vote
1answer
36 views

$(shell [foo]) in windows

I've got a makefile (a file called 'Makefile' which is run by cmake I believe), and most of the 'sample' ones I can see are just one line (and the rest appear to be stuff I don't 'yet' understand and ...
1
vote
1answer
80 views

Pre-compiled command line input in zsh

I recently set up a ubuntu 12.04 64 bit machine. I use tmux with many open windows, all of them use zsh as shell, some of them through a chroot environment that uses the same home folder of the normal ...
1
vote
1answer
287 views

Can I detect the presence of a second display in a shell script or Conky config?

I want to modify my conky placement depending on whether I'm working with my laptop in my lap (one screen) or have it at my desk attached to a larger monitor (dual display). The problem is that I ...
1
vote
1answer
310 views

Why do I sometimes get 'sh: $'\302\211 … ': command not found' in xterm/sh?

Sometimes when I simply type a valid command like 'find ...', or anything really, I get back the following, which is completely unexpected and confusing (... is command name I type): sh: ...
1
vote
1answer
29 views

Register a file specified by open

So I have this small bundle with applescript made, and it even seems to work as it should. However, it appearently doesnt open my files when it is asked to via the open utility. It works though when I ...
1
vote
1answer
52 views

Select set variable value in SSH session

I'm writing a shell script. It will run from machine A, which will SSH into machine B and prompt the user to select a build folder. It'll then copy it to machine A, but I don't know how I can have the ...
1
vote
1answer
37 views

Does this spawn multiple processes

I would like to know if this shell script line spawns multiple processes: nohup openocd -f board/stm32f4discovery.cfg >>/dev/null 2>>/dev/null & other operations here Basically, I ...
1
vote
1answer
311 views

Not able to call command from within the script

i have installed oversip & when i try to execute the command "oversip" from shell, [root@vhost1111 ~]# oversip NOTICE: <executable> OverSIP 1.3.8 starting... it gets executed. But when i ...
1
vote
1answer
358 views

run a shell script on terminal if terminal is idle for few minutes in linux

i can get terminal idle time by w command as follows $ w 14:37:58 up 2 days, 20:16, 2 users, load average: 0.12, 0.16, 0.14 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT ...
1
vote
1answer
369 views

Manually run “Run” registry entries on windows

I am developing an appliance for a company. I have to develop a custom "explorer.exe" to be run as the shell. The problem is that the current explorer does some import operations such as processing ...
1
vote
1answer
294 views

error occur when i run awk command write in .sh file and run in cygwin terminal

i have cygwin terminal for run shell script(.sh ) file...it work good..but when i add awk command in shell script and then run Error occur /usr/bin/gawk.exe: error while loading shared libraries: ...
1
vote
1answer
593 views

Ubuntu kill java program started by bash

I've got a problem with killing my Java Program on Ubuntu. I created the following init script: #!/bin/sh ### BEGIN INIT INFO # Provides: control ... # Required-Start: $remote_fs ...
1
vote
1answer
285 views

How to run a shell script on a Mac (10.7.4) to auto install updates?

Im trying to run this shell script that is supposed to do this: This script uses the softwareupdate program on OSX to automatically check for updates and install them. It also logs all updates to ...
1
vote
1answer
425 views

Applescript to shell script watch folder

I am trying to setup a watch folder so that when a file is added to a folder, I can run a shell script...for this purpose I made a simple test but cannot make it work... Here is my applescript on ...
1
vote
1answer
1k views

how to connect to secured wireless network connection in cmd in windows?

I program on C#, I don't want to use P/invoke, so I will use shell, so I need to connect to a secured wireless network connection on the CMD in windows, I know how to connect to a wireless network but ...
1
vote
1answer
240 views

Pass filename to shell script

On Windows, I can drag and drop a file to a batch file to pass the filename. On Ubuntu 12.10, I can't drag and drop to an .sh file. Opening terminal and running ./sh-file-name.sh file-name.txt ...
1
vote
1answer
714 views

Shell replacement for kiosk environment with desktop icons

I have to deploy around 80 touch-screen terminals for my company. We're going to run several Windows applications on those terminals and they'll be operated by touch input only. I basically want those ...
1
vote
1answer
173 views

Get PS1 evaluated value, or shell prompt value

I am trying to find the command that would return me evaluated value of $PS1 variable or just shell prompt with current path. e.g. foo-user@bar-pc:~\bar I would like to avoid using something like, ...
1
vote
1answer
212 views

Limit CPU usage KSH script

I have a KSH crawler script that crawls filesystems on my network, and i would like to limit it to 25% cpu usage, so it does not impact running systems. I am currently using nice but when i run SED, ...
1
vote
1answer
166 views

bash starts replacing the characters on the current line insead of moving over to the next line

I use bash shell $ bash --version GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. $ Sometimes, when typing a command on the prompt ...
1
vote
1answer
449 views

Emacs “shell-command-on-region” does not pass STDIN to command if command line contains meta-characters

I'm running Emacs on Windows-XP SP3 GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of 2008-09-07 on SOFT-MJASON When I run a command where the argument contains shell meta-characters, my Emacs region is ...
0
votes
1answer
12 views

What is CMPRS in this top command output?

Processes: 264 total, 2 running, 9 stuck, 253 sleeping, 1229 threads 2015/04/13 17:17:48 Load Avg: 1.00, 1.22, 1.24 CPU usage: 6.36% user, 21.81% sys, 71.81% idle SharedLibs: 14M resident, 16M data, ...
0
votes
1answer
24 views

Is it possible to delete directory when in the directory in shell

I have a directory which I run a program in. /usr/bin/my-dir I need to run the program from within the directory So I must go cd /usr/bin/my-dir ./my-program I have a script that from a ...
0
votes
1answer
18 views

Remove a specific string common in multiple lines in a CSV file using shell script

I have a CSV file which contains 65000 lines (size approximately 28 MB). On each of the lines they have a path in the beginning in the format of: c:\abc\bcd\def\123\456. Now let's say the path ...
0
votes
1answer
36 views

How to use custom shell on windows 7 when connected remotely via thin client

We have a Win 7 PC that runs software within a custom shell. This shell blocks users from the operating system depending on who is logged in. When no one is logged on, the OS is inaccessible. This ...
0
votes
1answer
38 views

How to run a script on ssh login and run another script after the first terminates?

I'm trying to run a script/shell just after I login via ssh to my host with a "guestUser" the mission of this user is to connect to another remote host via ssh, I've created this user on my host: ...
0
votes
1answer
56 views

Output of the ps command and understanding the flags

Ubuntu 12.04 LTS using bash. I tried running the ps command from a Java program using the Runtime and got some unexpected output. Upon closer inspection I realized that it was the output of: ps ...
0
votes
1answer
38 views

How to “sort” .torrent files by tracker?

I have a directory with a lot of .torrent files, and I want to get only the one with specific tracker(s). Is there a way to find them? The only way I've found so far is to add them all in a ...