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
17 views

how to list current path mode?

If the current path is /data/db_1, and /data has three subpath, db_1, db_2, db_3. I want to know db_1’s modification, owner and group. Currently I use ls -li /data |grep db_1 , but I think there ...
0
votes
1answer
4 views

Running the command “bochs -q” from Cygwin fails

I'm having troubles to execute the command "bochs -q" from Cygwin. I have installed the XV6 operation system in my C drive. I'm using Cygwin in order to compile the XV6 files, that is execute the ...
0
votes
1answer
14 views

Attempt to hide console using Command line, Run, Exec and Pipe in VBScript

I'm using Zbarimg which (I believe) outputs its data to STDOUT. So at present, a cmd string within a VBScript executes the command and stores it in a variable, thus: ...
0
votes
1answer
19 views

Start two scripts that run indefinitely in shell script

I'm a webdev and I am using JSX compiler and SASS preprocessor to compile my .jsx and .scss files. When I start working, I launch these two separate commands: jsx -x jsx jsx js --watch --no-cache-dir ...
1
vote
2answers
13 views

Is there a way to have sh/bash/zsh “case” use a variable for a test value?

I'd like to have something like the following: #!/bin/sh # ... other stuff ... # some relatively static possibilities (srsp): srsp='this|or|that|the|other' # more other stuff case $something in ...
1
vote
1answer
14 views

Linux shell: how to add prefix string to stderr message?

I am running several tasks simultaneously at background. command_a | tee > command_a.log & command_b | tee > command_b.log & If everything is fine, then messages will be saved to log ...
0
votes
2answers
29 views

What are the differences between “sh file.sh” and “source file.sh”?

I am trying to set up a cron job to run regression tests for software that usually runs in an interactive environment (CASA, for the morbidly curious: http://casa.nrao.edu/). I have a shell script, ...
3
votes
1answer
34 views

how to control users login on Linux machine according to configuration file

I use the PAM to authenticate users login info from - http://linux.die.net/man/8/pam_listfile in my Linux red-hat machine I have 5 diff users user1 user2 user3 user4 user5 I want to enable ssh ...
1
vote
3answers
28 views

sudo command won't run from script

Linux Mint. Ok, this is going to be seriously basic but for some reason, I am mis-understanding how this works. If I type the following commands, everything works fine: cd ...
0
votes
0answers
17 views

How to pipe arguments into stdin?

I am trying to generate a private key using keytool command, but it asks me for many details like my key passphrase, my name and my organization details. I want to pass all the inputs in one command. ...
0
votes
0answers
26 views

Crossfading Video AND Audio with ffmpeg

This Super User answer crossfade between 2 videos using ffmpeg has got me so far, but now that I have tried many solutions and seen every SO link out there, it's time to ask you all for help. I am ...
0
votes
1answer
20 views

tmux: Detect which process runs in the active pane

Is there a way how to detect what process runs in the active pane? tmux: Find "my" window, check if it's active is related, however, it deals with the detection from within the pane. I ...
0
votes
1answer
48 views

What do these parameters do?

What is the meaning of the switches and parameters of this command? exec su -s /bin/sh -c 'exec "$0" "$@"' root -- /opt/nsq/bin/nsqd Specifically the -- part and what exec "$0" "$@" is supposed to ...
2
votes
1answer
46 views

strange if statement behavior on linux

I am writing a shell script and have come across some weird if behavior. My question is simple, why does [[ "╝" = [█] ]] evaluate to true? Is it because they are both uncommon ascii characters? On ...
0
votes
0answers
16 views

`newgrp` breaks source-ability of shell script

This is my minicom.sh, which I can source successfully with source minicom.sh: minicom --device /dev/ttyUSB0 --baudrate 115200 --color=on However, when I change the content of minicom.sh to this, ...
0
votes
1answer
27 views

Exit bash script when curl gets a non 200 HTTP status

I have a bash script setup to perform a few curl requests for currency in EUR INR JPY do curl -i --data '{"currency": "'$currency'"}' -H "Accept: application/json" -H "Content-Type: ...
1
vote
2answers
21 views

Not creating new file while output redirection

I'm using this for output redirection: cat filename | grep 'dis' | wc -l > test.txt But I do not want a zero byte file created if no result is found from the grep command. Is there any way this ...
0
votes
1answer
42 views

ssh ForceCommand with Match

I try to setup a ssh server which is a kind of jumping host to other servers reachable via ssh. For that I use the ForceCommand like this: Match Group g_ssh ForceCommand nc -q0 my_internal_server 22 ...
1
vote
2answers
31 views

Wrong exit status upon evaluation of command substitution via ssh?

I've the following simple shell command which I'm expecting to fail and it does on my local: $ DIR=$(false) && echo ok || echo fail fail $ sh -c 'DIR=$(false) && echo ok || echo fail' ...
0
votes
1answer
16 views

Custom bash 'context' when running from FISH

First of all, I'm on OSX10. My default shell is BASH, which I have set up (through .profile and .bashrc) to automatically run the FISH shell when I open my terminal emulator. This allows me to set up ...
0
votes
1answer
38 views

How to get count of files in directory using command,exe in c# app

I want to use the Process class to execute a command.exe method to return the number of files in a parent directory. It has to be using the command.exe (various reasons). This is my code: ...
0
votes
1answer
24 views

Enable autocomplete in archlinux adb shell

In archlinux, when using the command adb shell provided by the package android-tools to obtain a shell on an Android device, the auto-completion using Tab is not working. Everything else is working ...
1
vote
0answers
17 views

Run shell commands in windows background

Hope you all are in good health. I have a silly question. Can we run shell commands in Windows in background and check it later whether it is still running or not. For example, we have "screen" ...
0
votes
1answer
25 views

Executing Perl command from shell script not resulting into anything

I am trying to execute the below command from a shell script: perl -pi -e 's/Ç/|/g' diff_new_old.dat This command gets executed without any errors, but the execution doesn't do the intended ...
1
vote
2answers
68 views

Bash: can't type 'e' or I'll get infinitely repeating 'H's

At my workplace, there are several independent networks I work with, all running various versions of RedHat Linux 4, 5, and 6. On one of those networks, I can't use bash (or, as I'm finding out, ...
0
votes
1answer
25 views

How can I make shell autocomplete the beginning of a filepath?

I have a project with a deeply nested folder structure. Most of the time I know the name of the file I want to work with, but the folder path is too long/complicated to type when I want to edit it, ...
0
votes
1answer
44 views

Use shell provided by non-root user

What is a good way for a non-root user to use an executable that is not in the system's list of shells as if it were the user's actual shell? I'm trying to do this with two different versions of ...
3
votes
2answers
29 views

How to tell of a GZip file is still being written while being copied

I am getting a gzip file in a path. Input Folder Path: <server>/input_gate I want to check whether the GZIP file I am getting in this folder are valid? I have used the following command. It ...
1
vote
1answer
19 views

netstat showing multiple responses for single listening process

Why does netstat -lntp show multiple responses as 0.0.0.0:22 & :::22 for a single sshd process? Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program ...
1
vote
1answer
66 views

Why does root cron job script need 'sudo' to run properly?

I'm running this simple script on my Raspberry Pi to auto update so I can forget about it. It also keeps a log that says whether the update was successful. The script is update.sh: #!/bin/bash echo ...
0
votes
0answers
20 views

Favorites Folder(Shell Folder) was set to %USERPROFILE% as its file location in Windows 8.1

I changed the location on all of my personal folders(shell folders), then realized that when browsing for a file from chrome, the favorites menu in the explorer navigation pane was empty. I went to ...
0
votes
1answer
67 views

Determine vulnerable programs affected by glibc's ghost bug?

How do I determine the programs that are installed on my system which could be vulnerable to glibc's ghost bug? (Presuming the system has a vulnerable version of the libc6 library). Posts like How To ...
0
votes
0answers
10 views

Linux cannot work with file “-c” [duplicate]

I have this file created accidently I guess but cannot handle it: -rw-r--r-- 1 root root 329 Dec 11 08:59 -c :~# cat "-c" cat: invalid option -- 'c' :~# cat '-c' cat: invalid option -- 'c' :~# ...
1
vote
1answer
35 views

Environment variables on Linux-like systems

How to set environment variables for a user in most generic way that is independent of shell environment variables (like profile for Bourne-like shells, bahsrc, zshrc, zshenv, ..)? The idea is to set ...
0
votes
0answers
23 views

Windows shell: title command argument too long. How can I enlarge?

I need to change the title of the shell (classic cmd) window in my Windows 7 SP1, but it seems to have a length limitation for some too long strings: C:\Users\Luis>title ...
2
votes
1answer
55 views

Inconsistencies on MD5 checksums

I am trying to obtain the md5 hash of a string. Said string consists of only uppercase and lowercase letters and digits. No other characters, including spaces and newlines. The string is inputted via ...
0
votes
0answers
9 views

Calling guest scripts in Oracle VirtualBox

I'm using Oracle VirtualBox. I want to run a script from the host computer to execute the following steps: Start the virtual machine Execute a script on the virtual machine Close the virtual machine ...
0
votes
1answer
34 views

How can I write a script to kill process that runs for a few hours?

I run python script from cron every hour on CentOS 5 and see some processes keep running for a few hours I would like to run a script every few hours to kill those processes. How can I write the ...
-3
votes
1answer
40 views

Set nano as a default editor over Vim [duplicate]

Every time I login to ssh terminal to edit files I execute the command export EDITOR=nano How Could I set nano as default editor so I shouldn't execute this command anymore
0
votes
0answers
26 views

Piped processes in upstart shell script continue running after stopping

I have an upstart script on my CentOS box that runs a shell script. The shell script runs a netcat command whose output is piped through a couple other commands and then ends up in a file. When I ...
0
votes
0answers
19 views

Configure a default shell script environment

Is there any way to change the default environment when running sh -c <command>? It appears that .cshrc is not called when running command with a -c flag.
0
votes
1answer
99 views

Make Applescript wait for an application to be closed before running a shell script

I have an applet i made using Applescript which opens an Application and then once it's loaded runs a shell script which unload's Spotlight. I need to make it then wait for me to finish using relevant ...
0
votes
0answers
31 views

How to change default shell for a network user?

I am working with Ubuntu and I would like to change my default shell to z shell. I cannot use the chsh -s /bin/zsh or chsh-s /bin/sh myuser command since my user name does not exist in /etc/passwd and ...
0
votes
0answers
39 views

Error using Putty when connected to a Windows server 2003

I am using Putty to connect to Freesshd running on windows server 2003. I can connect ok, the server log confirms that and confirms shell service is granted. At the putty end I get a terminal ...
0
votes
1answer
55 views

Sed replace line stored in a variable

I need to find a line that starts with mysql.unmetric.twt.url and replace the entire line with line stored in the variable ip. ...
0
votes
1answer
29 views

Bash script failure

I have this script. It works fine on one of system but it's giving some error on another machine: 1 #!/bin/bash 2 EXEC_DIR=`dirname ${0}` 3 source ${EXEC_DIR}/config.sh 4 5 ...
1
vote
1answer
94 views

Variables in linux shell script and user input

Hello I'm trying to make a short script that is supposed to take user input in the form of a file ending like .txt or .odt and type out how many files with that ending the directory contained. So it ...
1
vote
0answers
46 views

Is there a Unicode-aware LC_COLLATE sort order which respects punctuation?

As far as I can tell, setting the environment variable LC_COLLATE=en_US.utf8 changes four things compared to LC_COLLATE=c, regarding how programs like ls will sort files: Unicode characters are ...
0
votes
2answers
21 views

Using “for in” to iterates files but except specified one(s) in shell

I found a post here How can I run mogrify, but prefix the filename? which is talking about resizing a batch of images. In it there's a for in shell script. How do I except some single file(s) while ...
0
votes
0answers
29 views

appying dos2unix on all files under folder

I am trying to appply dos2unix on all files. find $WORKSPACE/itrp-sr -type f -exec unix2dos.exe {} \; but is resulting in an error 1 [main] find 3468 fork: child -1 - forked process 4524 died ...