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
1k views

Is there a way around broken pipe?

I have a directory with a large number of files. ./I_am_a_dir_with_many_subdirs/ Within a script I'd like to find all subdirs in it, to sort them and to output to a bash array. So, I do: ...
0
votes
0answers
17 views

(MAC) Change location of shell script's shell

When I make an executable shell script ("http://chimpy.wordpress.com/2010/08/29/mac-os-x-shortcut-link-to-python-script/", but without the python part), It's pointer location (The location commands ...
0
votes
2answers
323 views

curl shell command always returns error status 0 - even when fails on input errors

Example: trying to upload a non existing file - curl -d @no-real-file http://google.com | echo $? - returns 0. How can I make curl fail on input errors?
0
votes
0answers
36 views

open a new screen in linux, no access to perl local library

I added my perl local library to my shell startup script (.bashrc) and when I start a terminal in linux: $ echo $PERL5LIB /home/perl5/lib/perl5:/usr/share/vcftools/perl BUT when I open a new ...
1
vote
0answers
26 views

tmux completion (not shell completion)

Is there any way to do completion of arbitrary text from your tmux session (e.g. output from previous commands)? Something similar to hippie-expand in emacs or Any word completion in vim? Note that ...
0
votes
1answer
78 views

input from shell in bash script

i have a bash script i would like modify to support input from shell atm i have to type the link after i have run the script wiak@test:~$ scripts/lget.sh gimme cookie! ...
2
votes
2answers
167 views

Linking multiple files

In bash, say I want to link some but not all files from a directory, e.g., ln -s /dir/file1 /dir/file2 ... /other/dir but the format of the names of the files do not follow some simple rule, so we ...
1
vote
1answer
741 views

Creating a zip file with a timestamp

I have been trying to create a script which compresses a directory with a timestamp and move it to another location on the same server, but I cant seem to get TESTDATE to display on the zip file, ...
2
votes
3answers
121 views

How can I find folders containg x files of a particular type and output those paths on OSX

I have this script for OSX for finding folders that only contain one file, and if that file is an audio file outputting the path of the audio file find "$1" -type d -exec sh -c '[[ $(find "$0" ...
0
votes
2answers
75 views

I want to find out word which ends with ()…Use grep

I want to find out word which ends with ()...Using the grep command in linux. grep file_name_where_i_want_to_search "*()" some thing like that....but its not working
0
votes
0answers
38 views

“Send to Mail Recipient” showing up in the SendTo folder but not on Right Click

Strange issue that's coming up on a user's computer, but I am unable to reproduce on my own computer. In %AppData%\Microsoft\Windows\Sendto, the user has the "Send to Mail Recipient" shortcut. ...
1
vote
1answer
185 views

OS X Automator Shell Script for custom search with special character not encoded with utf-8

I find a script here Mac OS X (Lion) Chrome: shortcut for "Search With Google" which shows how to do google search using shell script in OS X Automator. The original script is: open ...
0
votes
2answers
240 views

CygWin terminal in remote console (SSH) not starting at correct $HOME path

I have installed CygWin v1.7.28. The problem quickly explained: Basically, when starting a CygWin shell via remote login, the $HOME is not where it should, with all derivated (bad) consequences of ...
0
votes
2answers
99 views

Shell not expanding *

I am setting up a java classpath in a bash script. I thought that I would have to use quotes to prevent shell from expanding the * based on this question: ...
1
vote
3answers
64 views

Is the word shell a synonym of process?

From this article: Sourcing will execute the commands in the current shell, executing will create a new shell and execute the commands there. He describes that each shell has its own PID. I ...
1
vote
2answers
212 views

How to invoke shell script while staying in interactive mode

When I call: execl("/bin/sh", "/bin/sh", (void *) NULL); The /bin/sh/ program is started, which opens a shell in which I can type commands. However, if I call: execl("/bin/sh", "/bin/sh", ...
0
votes
2answers
58 views

Zsh: how to auto complete after a command?

everyone. It's a little difficult to explain what I want to do. I want to create a script 'example', which can input long commands for you after you run it with short parameters. For example, $ ...
1
vote
2answers
300 views

Difference between “ls -lh” & “ls -lh | tail -n +2”

I was going through the split command article on internet and came across this Linux command ls -lh | tail -n +2 for listing files. Is it any better than ls -ltrh (which shows almost the same listing) ...
2
votes
3answers
1k views

Vagrant provision script: echo “source /root/.venvburrito/startup.sh” >> ~/.profile fails

I'm running my vagrant provisioning with a bootstrap.sh script. The script runs fine except for one line: echo "source /root/.venvburrito/startup.sh" >> ~/.profile This line fails. I don't ...
0
votes
2answers
153 views

How to exit a batch script when a command is not found

I want the terminal to close itself if adb is not recognized. ADB is a program this script will utilize to detect device. Here is a bit of my script echo My name is RomBreaker echo. echo And I'm ...
2
votes
3answers
766 views

Tool to record an interactive bash session to shell script

Is there a tool to record an interactive shell session to a shell script? For example if we entered in a terminal: interactive2sh reconfig_foo vim /etc/foo.cfg ibar^ESC:q /etc/init.d/foo restart ...
1
vote
1answer
150 views

How to set RTC alarm from script or terminal in OSX?

I have a iMac mini running OSX for powerpc which I want to use for remote backup. The backup will be run via a bash script with rsync over ssh. To save energy the computer is automatically put to ...
0
votes
1answer
33 views

commands depending on std input not working right

that's my code bash << EOF read EOF here, the read command fails and it doesn't read from the std input and here bash << EOF read ls ls EOF only the second ls is ...
0
votes
0answers
21 views

Vista 32bit Ultimate Shell Folder “Videos” disappeared

Forgive me if my terminology is not correct, I am referring to the special Blue folders in Vista which have an additional "Location" tab in their properties window. 500GB disk partitioned into C: ...
-1
votes
3answers
78 views

Create one file per line via shell

I have a file containing list of filenames, like this file1.cfg file2.cfg file3.cfg I want, using the linux terminal, to split this into n files with the given filename, each also containing the ...
5
votes
2answers
349 views

What is the equivalent of bash's !$ and !! in the fish shell?

I've been using bash for a decade or so and have gotten used to being able to type !$ to repeat the last argument, e.g.: $ mkdir foo $ cd !$ cd foo (That last line is printed by the shell to tell ...
0
votes
1answer
30 views

monit fails to support dbus session

I am trying to use monit to monitor and automatically issues like crashes, memory leaks and cpu hotspinning. For one application - one that uses DBus (serving and calling funcs) just will not start. ...
0
votes
0answers
29 views

with rlwrap vi file edit not happening

Am using rlwrap,with that history fetch commands editing works fine. But in vi mode am not able to edit the file, and not able to exit from vi mode. I added following entries in inputrc, set ...
1
vote
2answers
44 views

web-based interactive MAN pages [closed]

So, there was this website where you type a unix command and it would break the command into its arguments explaining what does what. I suppose it was based on MAN, but I'm not sure. I lost the ...
0
votes
1answer
111 views

bash: Running a program from the console without holding it up or line noise

I would like to run programs (for example, opening PDFs in Evince) from my bash shell. However, when I do this the simplest way (evince filename.pdf), the shell doesn't let me input anything until I ...
0
votes
3answers
29 views

How to get out of being suspended by bash console?

In unix-like system terminal, I sometimes used some commands incorrectly and make bash don't know what to do, but just pending on a newline. e.g. grep 'word' -R Then how can I make up to the ...
0
votes
1answer
76 views

Bash single quotes in find command

I'm having some troubles getting a shell script to work. I'm trying to dynamically generate the find command based on user input and I'm running into the problem that my variables in the find command ...
0
votes
2answers
119 views

What are the differences between each virtual console (Ctrl+Alt F1 - F6)?

In Ubuntu, there are 6 virtual consoles, which can be accessed by pressing Ctrl +Alt + F1 - F6, and F7, to exit. What are the differences between these virtual consoles? Do they run different things, ...
1
vote
0answers
367 views

find command with exec sh doesn't work in shell script but in commandline (raspberrypi)

I want to find "old" folders in /volume1/photo/ipcam which are named like "????-??-??" and move corresponding folders within dropbox (with the same directory structure /ipcam/...) to the subfolder ...
2
votes
2answers
105 views

env -i zsh | How is this magic possible?

I'm currently working, for school, on a home-made shell, therefore I'm kind of curious nowadays about how shell vars are set. Yes, this can be really exciting ! Anyway, we obviously have to deal with ...
1
vote
1answer
383 views

Infinite loop in Terminal (ksh) to launch commands

I'm trying to create a loop in terminal to launch every second during the execution of an script the following command. I don't want to create the loop in .sh script file, i'm trying to do in the ...
0
votes
0answers
151 views

Only single beep for a series of bells in PuTTY

After typing echo -ne '\a' && echo -ne '\a' in PuTTY session only single beep is being produced on local computer instead of two beeps. What is the reason? In PuTTY settings for this ...
1
vote
0answers
55 views

Cron deamon written in shell

I'm looking for a script in bash or ksh, that would do ... more or less ... the same as crond. The situation is, that our system administrator suddenly denied the use of crontab to all regular users ...
0
votes
1answer
31 views

post-order for find -exec?

I want to remove certain directories from a hiearchy using 'find -exec' find $rootdir -type d -name target -exec rm -rf {} \; I get error messages find: `foo/bar/target': No such file or directory ...
-2
votes
1answer
75 views

On telnet session file edit not happening using vi editor

I used rlwrap because with telnet session arrow keys were not working, after starting telnet session with rlwrap am not able to edit the file in using vi editor. Whether its problem with rlwrap.If i ...
0
votes
2answers
71 views

How much delay does two sequential linux commands have if they are run as a shellscript?

I have two commands A and B. I want to execute them together, but the only feasible way in linux is to use &. That is, $ A & $ B I don't expect 0 delay two commands, but approximately, how ...
1
vote
0answers
63 views

Windows 3.11 maximized shell window in SYSTEM.INI

I use a way to run 16-bit applications by running them in emulated Windows 3.11 in DOSBox. I automatically mount the directory containing the application, set the SHELL property in SYSTEM.INI to the ...
0
votes
1answer
77 views

shell command to create system v ressource key compatible to ftok system call

I'm working with system V shared memory in an application. during development I need to inspect and, sometimes, delete the memory segment. I know there is the ipcs command to inspect shared memory, ...
0
votes
0answers
59 views

Ubuntu: `env -i bash --norc`, but include essential variables such as HOME, DISPLAY? (where are these set?)

Is there an easy way to isolate a session of bash so that only essential variables (HOME, USER, DISPLAY, etc.) are preserved? (essential in that many programs fail if HOME, DISPLAY, TERM, SHELL, etc. ...
0
votes
1answer
241 views

zsh (or maybe oh-my-zsh) history gets confused with multi-line commands

if I use the up arrow in a zsh session, as you'd expect I get previous commands, from newest to oldest. Now (whether it's zsh or oh-my-zsh doing this I don't know), but if I type the start of a line ...
1
vote
1answer
27 views

Is it possible to sed -i from a text file to another text file?

I'm coding a shell script on my Debian box and there's a line on the script that needs to delete some emails from a textfile that is full of emails, like this: sed -i ...
0
votes
0answers
181 views

how to send encrypted mail using mailx command in unix

I want to make my email encrypted as email is confidential. Can anyone please tell me how to encrypt the email using the mailx command. In my shell script I have already used mailx to send the emails, ...
2
votes
1answer
139 views

How to encrypt my everchaging files for Dropbox while keeping them decrypted locally? [closed]

I would like to encrypt my files for outside use (e.g. for Dropbox), but keep them unencrypted on my hard drive (for instance, to be accessible by indexing and other 3rd party software). Similar to ...
2
votes
1answer
80 views

Hex of filesize

I am following a tutorial on few kernel dev. I encountered an operation where I have to use dd like dd ... if=PBL.bin of=... count=block_number The block_number variable is defined to be as The ...
1
vote
2answers
2k views

Mac Terminal showing bash instead of my username

This makes it hard to know what directory I am in. I installed a version of python for school and now it says -bash-3.2$ instead of MyMacbook: ~$. I'm sure this is really simple, but I know nothing ...