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

learn more… | top users | synonyms

0
votes
1answer
66 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
65 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
58 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
30 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, ...
1
vote
1answer
222 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
32 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
150 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
41 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
53 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
173 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
113 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
21 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
40 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
90 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
29 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
52 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
50 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
37 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
717 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
41 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
93 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
59 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
34 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
62 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
11 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
48 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
48 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
49 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
20 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
268 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 ...
1
vote
0answers
54 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
54 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
95 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
40 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
136 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 ...
2
votes
1answer
85 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
24 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
39 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 ...
10
votes
4answers
618 views

Is it possible to print out the shell expansion?

I know there is a specific set of rules that shell expand the commands user typed. (let's talk about bash shell.) Is it possible to print out a command in the form after shell expansion? It seems to ...
1
vote
1answer
41 views

Is it possible to 'source' the output of a python script

I have a large python codebase that knows a lot about my working environment. I would like to use it to set up my ZSH session when i open a terminal window. The python script would output text that ...
0
votes
2answers
80 views

Find availble disk space in unix without parsing `df` output

When I type df -k ., I get the following output Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda2 16512936 8650196 7023932 56% / What I do is tail the last line and ...
0
votes
0answers
34 views

getfattr format output to separate values of files by space or comma

I am using setfattr to store tags of files. Like: setfattr --name=user.tags --value="tag1, tag2" test2 setfattr --name=user.tags --value="tag3, tag2" test3 But getfattr --recursive --only-values -n ...
0
votes
0answers
36 views

How to pass a long list of files to a send-to command?

I have a batch script to perform a task on a list of input files. In order to call the script, I put a shortcut in the sent-to folder. Then I just select some files and select the script in the ...
0
votes
0answers
98 views

How to make an application accessible for ISPConfig's shell user?

We are using ISPConfig to manage our VPS. We have created a domain with a shell user assigned to that domain. There is an application installed on the VPS that is called Drush (shell application for ...
1
vote
1answer
36 views

shell:(foldername) doesn't work

I've accidentally deleted two of my user folders - Pictures and Videos on Windows RT 8.1. I've restored them using registration entries. The folders are restored but when I try to search for the ...
4
votes
1answer
2k views

How to update bash on Mac OS X Yosemite

Just trying to learn bash scripting a little. My old bash version: Bash version 3.2.53(1)-release... I've updated my bash on mac os x yosemite with homebrew: brew update brew install bash Then ...
3
votes
3answers
175 views

how to select nth result on command line without using mouse

I got this alias for searching for a file recursively and case insensitive type fr fr is aliased to `find . | grep -i' and so let's say i'm searching for a file fr nsstring+util ...
2
votes
2answers
79 views

Executable lauches if called directly from terminal, but does not work when called from shell script

I have downloaded some software (called samtools) and it is stored in a folder on my desktop. Then I've added the path to the executable into the PATH environment variable. In other words my ...
-2
votes
3answers
622 views

Bash- How to make a Linux script file human unreadable? [closed]

I have seen many Linux scripts that are executable but cannot be read as they are in binary format. My question is how I can make my script not readable/binary format?