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
0answers
34 views

Bash - log every input and output and write to file

I am often on assignment and sometimes I forget to document my work. E.g. write down output from different one off tools. Is there a way to automate that via .bashrc? So I open up a new shell, it ...
0
votes
0answers
5 views

Add git access to /bin/bash (chroot) on Ubuntu, using Plesk

I have a couple users who wish to use git, they are allowed shell access but are chrooted into their own directory. I assume there has to be a way without exposing options to any shell at any level to ...
8
votes
1answer
537 views

Why doesn't this softlink work as expected?

bash4.3 # pwd /bin bash4.3 # ll sh lrwxrwxrwx. 1 root root 4 May 17 22:22 sh -> bash bash4.3 # ll bash -rwxr-xr-x. 1 root root 1072056 May 17 22:22 bash bash4.3 # bash bash4.3 # ...
0
votes
0answers
18 views

Interruptable Loop that Does Not Interrupt Piped Processes

I'm trying to write a shell script which performs an operation every fifteen minutes until the user interrupts it, then aggregates all of the results to stdout and exits cleanly. My thought was to ...
0
votes
0answers
10 views

In fish shell, which command is equivalent to bash's compgen?

compgen is a useful command, and fish is an excellent command shell. But I cannot find an equivalent in fish. I write one by myself: function compgen --description 'Print a list of documented fish ...
1
vote
3answers
22 views

How to use test -h or test -L on OSX?

I'm trying to detect in a shell script if a file is a symlink pointing to a directory. This is what I'm doing: if [[ -L "$out_dir" && -d "$out_dir" ]] then echo "Dir is a symlink" else ...
0
votes
0answers
19 views

Execute a command stored in a variable

I want to write script that will show cpu utilization for one service. below is script and output for the same. Kindly assist. Script : yourpid=$(service tomcat_SP status | cut -d':' -f2) #this will ...
0
votes
0answers
27 views

command_not_found_handler not allowing cd command

I have the following code block in the ~/.bashrc file function command_not_found_handle { for dir in $@; do path="${path}${dir}/" done if [[ -d ${path} ]]; then echo "...
0
votes
0answers
9 views

How to make tmux kill session as normal on terminal exit

So normally when you have an X terminal and you exit the window, the terminal dies and HUP is sent to all processes that have that terminal as controlling terminal, their usual response is to exit ...
1
vote
1answer
49 views

run bat with a copy of cmd.exe in another path

I have a test.bat and a copy of cmd.exe (rename cmdnew.exe), both in a same folder. Question: How can i run test.bat with a specific "cmdnew.exe" (not with cmd.exe)? (how can i register the new path ...
1
vote
0answers
22 views

tmux always starts with `/bin/bash` instead of `/usr/local/bin/bash`

No matter what I do, tmux will always use /bin/bash as its login shell. I have set $SHELL to /usr/local/bin/bash which should work according to the man page of tmux. And $SHELL is definitely exported,...
0
votes
1answer
35 views

Shell context menu registry extension doesn't work when default program is other than Notepad

I'm trying to add a "Tail" entry to the shell context menu for .txt files, but whatever I do the option just does not appear. My .reg file looks like: Windows Registry Editor Version 5.00 [...
0
votes
0answers
24 views

Executing unix shell scripts on a remote server using local windows command Prompt

Does anyone know, without using any third party tools, how to invoke or call a Unix shell script from window command prompt or a batch file. Any links or pointers will be really helpful. Using Batch ...
2
votes
1answer
27 views

workaround for 'reopen' terminal (to access newly installed stuff)

Ok so basically I'm writing a shell script which needs to install nvm and then use it. Problem is, nvm requires that you close and reopen the terminal after installation. So I wanted to know if ...
-2
votes
0answers
28 views

Unable to locate Invisible folders

I have tried to search for X11 folder using locate X11 | grep "X11$" and also using find / -print 2>/dev/null| grep "X11$" but there are many invisible folders in my system as shown in the ...
0
votes
2answers
37 views

How can function definition be part of pipe sequence in POSIX shell grammar?

The POSIX shell grammar at http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02 says pipe_sequence : command | ...
0
votes
1answer
13 views

how to filter text file on the basis another text file.

I have two text files . One is wordlist and another one is file to be filtered. I want to remove or delete all the lines or links from the file if the line has any word from word list anywhere in ...
-1
votes
0answers
16 views

Shell script to login into Linux server by ssh [duplicate]

I want to write shell script to login by ssh and execute some command.
-1
votes
0answers
24 views

Windows Shell Functions [migrated]

So I was following this tutorial: https://msdn.microsoft.com/en-us/library/windows/desktop/hh127427(v=vs.85).aspx when I cam across the sentence that casually says "Call the SHChangeNotify function"....
0
votes
1answer
37 views

Shell script fails when executed by systemd service

So I have a systemd service called startup.service: [Unit] Description=startup scripts [Service] Type=oneshot ExecStart=/home/user/Documents/Tools/Scripts/startup.sh [Install] WantedBy=multi-user....
0
votes
1answer
43 views

How can I set a modified PATH for a non-interactive non-login POSIX shell invoked by Scons on Cygwin?

Because I work on a number of separate projects, (each of which uses a different compiler), I don't like to have the path to any one compiler set in my PATH. Now I have joined another project where ...
0
votes
0answers
45 views

How to boot tablet from usb

I need to boot my tablet from usb stick where my windows 10 install files are stored. There are no boot settings, I can access only UEFI shell see: That usb is blk0 and blk1 (when i unplug they ...
1
vote
0answers
30 views

Create tmux session in seperate shells

I'd like to use tmux sessions to manage windows / panes in different shells. What I've noticed is that tmux will always use the shell from which it was first launched for all subsequent sessions ...
0
votes
1answer
44 views

how can i make zsh tab completion fix capitalization errors? for directorys and files

I switched to zsh completely on a previous arch install and i LOVED it mainly because arch is one of the distros that capitalizes your Documents, Downloads, Music and such directories in your ~ ...
0
votes
0answers
11 views

FreeBSD google cloud image / set password auto for root etc

i want to use FreeBSD intro google cloud but i can't make the password work. Sorry for my bad english. Soo , i have this shell script for create image : VERSION=10.3-RELEASE VMSIZE=10g SWAPSIZE=1G ...
0
votes
2answers
66 views

Importing variables in one shell script from another without executing the referred shell script

I have 2 shell scripts, file1.sh and file2.sh file1.sh #!/usr/bin/env bash export var1="/data/share" export var2='password' echo "Hello" file2.sh #!/usr/bin/env bash source file1.sh echo $var1 ...
0
votes
1answer
6 views

(Linux) How to launch instance of an already running application in blocking mode?

For explaining I use Firefox, but it also happens with other applications, here's the script: $ cat ff.sh #!/bin/sh firefox http://superuser.com/ echo "$?" Let's say Firefox is closed, when I run $...
0
votes
1answer
26 views

Prepend file names in shell

I have 100 .png files in a folder say test.png, example.png, etc. I want to prepend them with New_ so that it will be renamed as New_test.png, New_example.png etc. How can I do it in shell.
-1
votes
1answer
13 views

Apply the “expand” command to a file in-place like sed -i

The expand command does not have the equivalent of sed -i <file> expand actually does have a -i option - but it means only after blanks Is there a sed - expand dynamic duo combination ...
0
votes
1answer
24 views

Add character before a very large file to send to a shell script

I am trying to run a shell script on a 31,65 Go json file. ./oetl.sh database.json I need to have brackets before and after the file. What I have in database.json : {..},{..},.. What I want : ...
1
vote
1answer
43 views

Linux Shell script to change grep for a string, then comment out 2 lines above and 1 below the string found in the file

Looking for some help on this task. I have tried several shell scripts to do this, but not sure I am approaching this problem right. I have a file that contains several blocks of data like this: ...
0
votes
0answers
19 views

Disable zsh prezto “completion” module autocorrect

I'm using prezto with zsh and its "completion" module has some autocorrect stuff which I don't want. I just want the autocomplete and menu highlights, but no autocorrection (which is dangerous and ...
-1
votes
1answer
24 views

How to write shell script to mount a sd card into a folder?

I need to write a shell script which should run on startup. In this script my aim is to mount my sdc dev into a folder . Normally if run mount /dev/ /foldername on terminal it will mount How can I ...
1
vote
1answer
35 views

LibreOffice OS X: converting a .odt to .pdf from terminal?

Using LibreOffice, I can open an ODT document and export it as PDF manually. Is there also a command line do to this from the shell?
1
vote
1answer
16 views

Change user in shell function?

I would like to change the user within a shell function. I guess its not possible to change the user in such a enclosed function, but is there another way to achieve something like that?: myFunction()...
0
votes
3answers
5 views

Shell command to calculate certain % of disk size

I am writing shell script to calculate 15% of total disk size of user's home directory. I have this command which gets me(somewhat) what I want but not sure if there is better way of doing this. df -...
0
votes
0answers
17 views

Why there is inconsistence of a shell command in the same shell

Like sed, there are shell command (or should I say it script language?) which don't behave in the same way in the same shell. Behavior of them seems to be different depending on OS (BSD or GNU) not on ...
1
vote
0answers
24 views

What is the difference between ulimit -r and -e?

What is the real-time scheduling priority mean (ulimit -e) ,and how to use it ? -r The maximum real-time scheduling priority -e The maximum scheduling priority ("nice")
0
votes
1answer
18 views

In Windows 8, where to manage shell context menu commands associated with file types?

Maybe this is a duplicate, but I cannot guess the correct teminology to find answer if it was posted already. Where in Windows 8 can I open the user inteface to add/edit/remove shell context menu ...
4
votes
3answers
64 views

How to create linux user with only and only READ permission not EXECUTE and WRITE permission?

I have created user, e.g. ronly, now I want to give them read only access to few directories on other user home like abc/,xyz/,pqr/ so I put this ronly user in others means not created any group for ...
0
votes
0answers
49 views

Convert powerpoint to markdown

Can I convert powerpoint to markdown? My ultimate goal is to create an easily versionable version of the powerpoint. (Maybe reveal.js or something)
0
votes
2answers
21 views

Unescaped commandline content in fish shell

Is there a way to get the unescaped content of command line in fish? I mean if command line is like ... $ ls 'foo' "bar" ... the desired output would be ls 'foo' "bar". The commandline fish ...
1
vote
1answer
14 views

How to get piped output in color?

I am using FreeBSD with the csh shell. As an example, in the terminal / screen I get color output for ls (eg. ls -lGs). But when I pipe it through more (eg ls -lGs | more) the output has no colour. ...
2
votes
1answer
50 views

LibreOffice on OS X: running soffice keeps saying no Info.plist or no NSPrincipalClass in Info.plist

I'm trying to run LibreOffice 5.1.3 from the OS X terminal, to script some conversion tasks. However whenever I run soffice, I always get this error: No Info.plist file in application bundle or no ...
2
votes
1answer
35 views

How to set different shell prompt color for each newly opened terminal

I am using Ubuntu and can manually change the bash shell prompt color to green using export PS1="\e[0;32m[\u@\h \W]\$ \e[m" However, I want the shell prompt color to automatically change whenever I ...
0
votes
1answer
46 views

Why does terminal repeat “//: is a directory” after I source .bash_profile?

Sergios-MBP:~ home$ nano ~/.bash_profile Sergios-MBP:~ home$ source ~/.bash_profile -bash: //: is a directory -bash: //: is a directory -bash: //: is a directory -bash: //: is a directory -bash: //: ...
1
vote
1answer
34 views

How to use '!!' (double exclamation) in bash script?

This is the scenario: Sometimes I want to open a list of files using vim. That list of files is output of a command. So I can type vim $(!!) and open those files after running that command. Is it ...
1
vote
0answers
39 views

Get desktop shell access by wired connection from Raspberry Pi

Today I asked my self if this was possible: Connect a Raspberry Pi to a desktop PC (Ideally to the motherboard, so that the Pi can be hidden inside the case) and then connect he Pi the the Internet ...
1
vote
1answer
43 views

Matching a randomly generated integer with a specific place value in a string

In bash I want to prompt user for input in a script. Lets say the input is: #!/bin/bash echo "Please enter a number." read NUM # User enters "12345678" How can I use the next command to generate ...
3
votes
2answers
97 views

How to start a screen session from a shell script using crontab and then reattach to it?

I want to run the following shell script (launch.sh) to start/stop a screen session using crontab !/bin/bash cd ~/screen DATE_FORMAT=+%Y-%m-%d:%H:%M:%S echo --- START --- date $DATE_FORMAT if [ -...