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

learn more… | top users | synonyms

1
vote
1answer
22 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
303 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
33 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
64 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
200 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
597 views

extract characters between first and second underscores of filenames and count such files in linux folder

I would like to extract characters between first and second underscores of filenames in a folder and count such type of files present in it. The folder contains files in a particular format such as : ...
1
vote
1answer
247 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
28 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
50 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
255 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
292 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
290 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
261 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
524 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
261 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
5k views

How to turn the laptop built-in webcam on/off from shell

Fn+F6 key combination turns my laptop's integrated web camera on/off. Looking at the dmesg output, it seems that the webcam (USB device) is being more or less virtually connected/disconnected to/from ...
1
vote
1answer
340 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
960 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
229 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
638 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
150 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
192 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
159 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
434 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
13 views

How can I configure the cancel button of dialog box bash?

dialog --backtitle "Dialog - Form sample" \ --form " Form Test - use [up] [down] to select input field " 21 70 18 \ "Network-ID:" 2 2 "" 2 15 20 0\ "Subnet Mask:" 4 2 "" 4 15 20 0\ thank you for ...
0
votes
1answer
17 views

disable users from creating new shell instances

Is there any way I can disable users from creating new shell instances through sudoers file? also disable them to set any environment variables? I would like to write a line in the sudoers file ...
0
votes
1answer
39 views

Ubuntu nested bash shell

Thanks for any help. I'm helping configure a machine to log keystrokes using /usr/bin/script function. For each session, a log file is created that includes the POSIX time. $PS1 is changed to reflect ...
0
votes
1answer
42 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
1answer
27 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 ...
0
votes
1answer
27 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 ...
0
votes
1answer
31 views

Where do the variables of a new BASH shell come from?

I am puzzled as about how environment variables work. From what I am aware, for a new process to have some environment variables, its parent must have issued export. But what about all the variables ...
0
votes
1answer
36 views

modify shell command in Ubuntu 14.04

I had installed Ubuntu 14.04 on virtualbox, I need to be able to read source code of shell commands, and modify any command? any help please? where i can find the shell commands? in which directory?
0
votes
1answer
27 views

Kill browser tabs with Bash from younger to older

Hello i want to kill tabs from a browser(ex. chromium) by order from youngest to oldest. I used pkill -f -n -9 chromium but i want to use it in a while iteration with comparison to pkill's return ...
0
votes
1answer
82 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?
0
votes
1answer
11 views

How do I recover from a `tmux a` by mistake within a tmux session?

I have a tmux session with a pair of windows. I want to recover the stdout from both those windows. I found this example, and so, within my existing attached session, ran tmux a. I now have a screen ...
0
votes
1answer
19 views

List folders by modification time of children in linux?

I have a folder, we'll call it /scripts/, that contains subfolders for a number of different scripts (let's say /scripts/file_export, /scripts/record_ingest, /scripts/stats). Inside these folders are ...
0
votes
1answer
13 views

Bash expansion to list from a directory

I tend to work on multiple projects, all stored inside my home (~) directory inside a directory called web. At one point all my projects were inside a single directory inside this; so to move from ...
0
votes
1answer
20 views

what's the way to explicitly provide memory to shell script?

How can I give a shell script specific amount of memory to run? If I run a java program I can use -Xmx. But what if it is a shell script?
0
votes
1answer
12 views

How to send process in background which has not started from shell?

I know how to send process to background and foreground which has started through shell using bg and fg commands. How can I send process which has started by clicking icons or menu? like I open ...
0
votes
1answer
428 views

OneDrive Subfolder Icons Keep Resetting

I'm having a frustrating time with my OneDrive client where, when I customize the shell icons for subfolders inside my cloud drive, it resets the icon to default upon synchronization. As frivolous as ...
0
votes
1answer
52 views

How do I make sure that bash (not tcsh) is used in Linux?

I have a bash script where I use ssh to connect to another server and run some commands there. I found some sites that the error (Warning: no access to tty (Bad file descriptor). Thus no job control ...
0
votes
1answer
69 views

How do I build a script shell to send cmd via telnet and log only results?

I would like to make a shell script that can call a range of IPs via telnet, to send a command, and write the result to a file.
0
votes
1answer
101 views

Monitor process start time, end time using shell script

I am working on project in which we execute shell script which invokes the Node process and further processing happens. I want to design a script which should log the start time, termination time of ...
0
votes
1answer
66 views

Memory usage of a process in a shell script

I want to find out the memory usage of a process in a shell script.I tried to use this piece of code : while[process] do if [ -e /proc/$pidno/statm ]; then m=`awk '{OFS="\t";print ...
0
votes
1answer
77 views

shellinabox - How can I restrict access to certain users only?

I've got a Ubuntu 14.04 machine which I've set up with shellinabox. Now I would like to restrict access to shellinabox to only a certain user account. Nobody else should be able to log in with it. ...
0
votes
1answer
37 views

compare 2 arrays eg. csv

i would like to know if it is possible to compare 2 list via shell. The setup: List "A" with about 6000 entries List "B" with about 300 entries Is it possible to detect wich are duplicate and wich ...
0
votes
1answer
51 views

Small bootable package to enable ssh client?

I've been trying to find the smallest possible package to put on a cd/thumbdrive that will allow me to use an ssh client on a wired networked computer. I'm talking about really barebones stuff, no ...
0
votes
1answer
56 views

stop all child processes when 1 of then returned exit code 1

I have 2 or more build processes to run in background. I want to stop all the build processes if one of them exit with code other than 0. ./build-1.sh & ./build-2.sh & ./build-3.sh & wait ...
0
votes
1answer
59 views

Bash doesn't source file unless manually started

bash won't source files from an login terminal unless I manually run bash from a terminal, I have bash (and not sh or dash). When I source a file, it returs errors (like "syntax error near unexpected ...