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

Easily print out a spaces between larger data outputs in bash

I'm grepping through a very large web directory, and when I do multiple greps in a row, when scrolling up, it is difficult to tell when one result ends and an other one starts. I tried just clear, ...
0
votes
1answer
33 views

How to run an infinite loop program on startup on a raspberry pi without halting boot up

I have a shell script: #!/bin/bash while sudo /home/pi/MyCode; do :; done echo Error with MyCode which runs a program in an infinite loop. I want to set up the shell script to run at start-up ...
0
votes
1answer
20 views

How to use the awk to print the output

This command nstats gives me output like below. How can I use awk or grep to give me the uptime with only days on it? I cannot use the "" to get the output. HOSTNAME LOAD MEMORY SWAP PROCS ...
0
votes
3answers
12 views

How do I close stdin in a shell script?

I have a misbehaving program that I need to call from my script. It exits as soon as it sees something on stdin. Is there a way to close stdin?
0
votes
1answer
16 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
0answers
10 views

SSH commands through HTTP REST API [on hold]

Is there any tool / server for running shell commands through http REST API? Preferably in Ruby. I need to run some commands in OpenShift Origin but they don't have API interface yet implemented.
0
votes
3answers
30 views

Moving folders in Linux inconsistency

I have a shell script that deploy an application to a staging server. However, one of the application's directory needs to be backed up and restored after the deployment (so it is not overwritten). I ...
0
votes
2answers
25 views

Shell script to SFTP file to remote server

This is probably a question asked before, but I can't find a good question/answer. I need to write a shell script that will be called by PHP program (exec function) to move all *.pdf files to a remote ...
0
votes
0answers
8 views

how to debug perl program like shell script debug is there using option -x [on hold]

sh -x shellscript.sh Already tried perl -d perscript.pl it works but quite lengthy process
0
votes
0answers
6 views

Aptana Studio: Git: shell directory: attribute added to end of directory prompt

I'm running Aptana studio 3.3.2. The command echo $SHELL outputs /bin/sh. However there is no value for the PS1 environment variable which I would like to inspect. I cannot there is no .bash_profile ...
0
votes
3answers
30 views

Why is this echo command not working?

I want to overwrite /etc/postfix/master.cf with my own content. I'm using echo "<content>" > /etc/postfix/master.cf to try and accomplish this. But when I do: echo "# # Postfix master ...
0
votes
2answers
26 views

How to execute multiple multiline mysql queries with a shell script?

I want to run multiple MySQL queries from a shell script. I'm using the following code: mysql -u <redacted> -p<redacted> servermail << EOF CREATE TABLE `virtual_domains` ( `id` ...
0
votes
2answers
18 views

followup: why are shebang files not suid-able?

followup question to http://unix.stackexchange.com/questions/364/allow-setuid-on-shell-scripts . there is a very good answer by Gilles. alas, I do not understand it. nothing described there seems ...
1
vote
1answer
30 views

Can't start new fish session after incorrectly closing fish_config

I'm trying out fish (the friendly interactive shell), and tried out the browser-based config with fish_config. I didn't close this correctly. I hit ctrl-C in my shell. Now I see the error "The ...
0
votes
0answers
6 views

Keep tclsh open after running script through notepad++

I'm currently writing a tcl script using Notepad++. I've edited the F5 key such C:\TCL\bin\tclsh.exe "$(FULL_CURRENT_PATH)" This will open a tcl shell & run the current script I am writing. I ...
1
vote
2answers
24 views

How to remove file modification tracking on an Emacs buffer?

I have a *shell* buffer in Emacs where I get a Linux command line shell interface. On occasion, I wish to save the buffer's contents to disk for future reference were my session to exit and once ...
0
votes
2answers
44 views

How can I colour-code files and directories in my shell environment?

I've seen many screencasts online in which the files and directories are colour-coded differently for ease-of-use. I'd like to achieve the same on in my bash terminal, on OS X 10.9 and using iTerm2. ...
0
votes
2answers
48 views

linux shell command to grep Unicode Character 'ZERO WIDTH SPACE' (U+200B)

How can I grep for Unicode Character 'ZERO WIDTH SPACE' (U+200B) in linux grep '%U200B' filename?
1
vote
4answers
163 views

Shell script: ssh to remote machine, then exit: 'exit' does not work

I have a shell script of the following type: #!/bin/bash ssh mylogin@myremotemachine.com echo "Hi" exit I run it locally to do something on a remote server (represented by 'echo "Hi"'). However, ...
0
votes
0answers
22 views

Netcat redirect remote console application

I have a windows interactive command line application ('pianobar', Pandora client) that I'm running on a Win2k8 server that I would like to control remotely, possibly using netcat. I need to be able ...
0
votes
3answers
39 views

How to find length of string in shell

i need to calculate it using pure sh shell only. What happening is /bin/sh is actually a soft link to bash or other shell.Hence ${#STRING} gives length of string as it is advance bash feature. Can ...
0
votes
0answers
32 views

sqlmap os-shell help needed

I am asking this question just for educational purposes. I run this command to upload php shell: ./sqlmap.py -u http://target.com/myfile.php?id=1 --os-shell And it succeeded: The shell uploaded ...
0
votes
0answers
7 views

how uninstall video card driver(integrated) in linux with shell command

Here is my problem: I was trying to update a new video card driver for my computer's Intel integrated display card, but the command " modprobe -r " return module is in use. I try to disable the ...
0
votes
1answer
12 views

Surpress execution trace for echo command?

I'm running shell scripts from Jenkins, which kicks off shell scripts with the shebang options #!/bin/sh -ex. According to Bash Shebang for dummies?, -x, "causes the shell to print an execution ...
0
votes
1answer
11 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 ...
1
vote
1answer
16 views

How can I run `M-x compile` under a particular shell in emacs?

I've a piece of software that can only be compiled under my-weird-sh. I like to use some-better-sh in my day-to-day work, so that is my login shell (via chsh). This changes the shell in Emacs to ...
2
votes
1answer
30 views

What does this zsh for syntax mean?

I working on source controlling my dotfiles and a lof of what I'm doing is based off of Zach Holman's dotfiles. I want to source all zsh files like he does in his files but before I just throw the ...
0
votes
1answer
66 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
23 views

including timestamp in file name

I tried to create a file like this to put a timestamp in the file name vim Customer1-$(date).txt The result was Customer1-Sat.txt, however, I wanted the full timestamp Sat 30 Aug 2014 09:41:27 PDT ...
0
votes
1answer
24 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 ...
1
vote
1answer
19 views

What's the soonest I can send a signal to a background process (trap)?

I have a script from which I run a second script in a subshell. What's the soonest that can send a signal to the second script? script1: ./script2 & kill -SIGCONT $! script2: echo "~~ ENTRY" ...
1
vote
1answer
22 views

Shell, subshell, source, background process, PID == confusion

I am trying to get my mind straight as to how all these things are put together. For example with this script: #!/bin/bash . script1 ./script2 . script3 & ./script4 & sleep 5 How do the ...
0
votes
1answer
21 views

why following shell script function failing?

_exec() { CMD="$1" echo "Executing command: $CMD" EXEC_OUT=`$CMD` EXEC_RET=$? } _exec "hostname|cut -d\".\" -f1 " SHORT_NAME=$EXEC_OUT if [ $EXEC_RET -ne 0 ];then echo "Unable to ...
0
votes
1answer
31 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
32 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
23 views

'dd' command on Damn Small Linux?

I looked at the package list of DSL, and I don't see 'dd'. For example I would like to restore /dev/sdb from an .img file like so: dd bs=1M if=/home/myname/image.img of=/dev/sdb What command do I ...
1
vote
0answers
18 views

Showing context menu option if extension is not .aent

I have made an application that can basically encrypt anything, I have added a registry entry in HKEY_CLASSES_ROOT/*/shell/ so that it's shown whenever one right clicks a file. but I don't want to ...
0
votes
1answer
30 views

Default prolog for all ZSH scripts?

I have a file that contains several helper functions, meant to be used only in other ZSH scripts. I do not want them to be loaded with my profile. To make these functions available in my script, I ...
0
votes
1answer
23 views

Weird output in my mac iTerm bash shell. How do I make it clean?

Setting up my bash and made some mistake. Here is my bash shell: android-c26f663baae722eb:~ okyretina$ I have used a clean .bash_profile and sourced it and the shell still have that weird ...
2
votes
1answer
66 views

Default shell for running scripts (w/o shebang) in macos?

I have ZSH as default shell in MacOS, everything is working fine. ZSH is installed as brew package, Ive set default shell in my account, new shell is listed in /etc/shells... everything is set, like ...
0
votes
0answers
40 views

Automaticly run xinit from rc.local as different user

I'm working on some tuning of my raspberry pi b+. So I decided that midori should start automaticly after autologin. With startx it works without problems, but X is still to ressource hungry. So I'll ...
0
votes
0answers
19 views

cygwin programs returning errorcode -1073741819 on Windows 7 cmd

Sometime in the last week or so none of my cygwin programs are running from the cmd shell of Windows 7 64-bit. Tried rebooting and reinstalling fresh, but with same results. After further analysis, ...
2
votes
3answers
57 views

Why is this sudo command try to run in /root?

I try to run a sudo command via SSH like this: ssh domain.com sudo -u user bash -c "cd /home/user/ && ls" (which is obiously just an example). I get back: /home/user/: line 0: cd: /root: ...
0
votes
1answer
25 views

How to get when run `top` command ports listed?

How to get when run top command ports listed ? I get info about process but I need port to see ( process dies very quickly , 0 seconds, and I cannot grep after ps aux ). Is possible to top command ...
0
votes
1answer
29 views

concurrent scheduled jobs and ora-27477

Need: To have Oracle kick off a shell script that performs processing on tables and data in the Oracle database. The script is instantiated by specific activity from web clients. Issue: Web clients ...
0
votes
2answers
48 views

is there anyway to get remote shell from windows to windows over WAN? [duplicate]

Is there any way to get remote shell (not RDP) from home PC to office PC? i have 2 pc's on 2 different places pc number one ip : 66.33.22.885 ( home PC ) pc number tow ip : 77.13.85.676 ( office PC ...
0
votes
0answers
15 views

How to batch download wikipedia pages as pdf?

I have a list of wikipedia pages that I'd like to keep updated in pdf format. What would be the easiest way to do this? The ideal workflow for me would be something that I can put into a shell or ...
0
votes
5answers
40 views

History in bashrc on login vs manual sourcing - clearing and loading

I use a bunch of different aix machines at work and need to share users with co-workers. To make my life easier but not bother others with my customizations, I have created a .bashrc file that I copy ...
1
vote
1answer
21 views

Hide all output from a background process

I have a bunch of commands in my zshrc which invoke another command in the background. The background command is an alias to a text-to-speech program (I use it to give me audio cues when processes ...
0
votes
1answer
37 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 ...