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
0answers
55 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
173 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
169 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
132 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
54 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
766 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 ...
1
vote
1answer
79 views

error handling in case sentences [Shell Script]

I have this setup and I need when an error happened in the main script, to take this error to a $INFO_PLUGIN temp file, the problem is the script continues working after case and send also an OK ...
1
vote
1answer
76 views

permission denied in running script

I am running a script but there is an unusual warning: This is what happened in my console #whoami root #ls -l test.sh -rwxr-xr-x. 1 root root 1894 Feb 2 01:58 test.sh #./test.sh -bash: ./test.sh: ...
1
vote
1answer
162 views

ZSH: Where to place environment variable so that launched application can pick it up?

I need an environment variable KEY="value" made available to a GUI application before starting it. The launcher file (the one that places the icon on the desktop and sidebar in Ubuntu) has a value of ...
2
votes
3answers
846 views

Windows 8.1 + Classic Shell, how well does it restore Windows 7's functionality?

I prefer a classic Windows UI. I enjoy Windows 7, but have heard that Windows 8.1, despite its unconventional interface, includes some under-the-hood improvements, such as faster boot times and better ...
0
votes
2answers
26 views

Copy folder and all therein to parentParentParentFolder

i have the following structure: NASEN/Backup/CRON/2014 i want the folder "2014" to be copied to NASEN/2014 How to do this considering i am in "NASEN/Backup/CRON/" or root "NASEN" to input the ...
2
votes
1answer
43 views

unix expr command shows strange results comparing integers

When I write expr 123 \< 5 the result is correct (0) because expr evaluates two integers. Also expr 123. \< 5 gives the expected result (1) because now it compares two strings. ...
2
votes
2answers
45 views

Locating the source of a function in zsh

I have this annoying issue in my zsh shell where a function is being declared somewhere and that function is named "cp" so it's overriding the normal cp behavior. I'm trying to locate the function ...
0
votes
1answer
13 views

How to enable special carachters in moc?

I am using moc (what is moc) on OSX 10.9 in the zsh. I want to enable special german characters like ä, ü, ö and ß for it. Does someone know how to do that?
1
vote
0answers
158 views

Adding a new (hidden) “Delete” Context Menu item to Windows 7

I would like to add a new "Delete" context menu item such that I can delete large amounts of files and folders with a single right click without using explorer because of how slow it is. I have ...
0
votes
1answer
37 views

Is it possible to connect to the local Windows shell with PuTTY?

I don't know of a working Windows SSH server (not one that I trust enough, yet, at any rate). Therefore, I can't simply connect to localhost on port 22 from PuTTY. I want to use PuTTY because the ...
0
votes
0answers
58 views

How can my bash script inherit core limits from a C shell?

I'm using tcsh for my shell. I disable core dumps by running "limit core 0". Running a program that crashes from my shell, I can see that indeed no core dump is generated. Next I have a wrapper ...
2
votes
3answers
815 views

Bash script, string not replaced correctly with escaped $ and & characters

I have created a shell script which takes a string as input. If the string contains $ or &, then I need to replace those characters with \$ and \&. I could done that with sed command. After ...
2
votes
3answers
232 views

How to set specific file permissions when redirecting output?

This is probably a duplicate, but all my searches are turning up questions about permission denied errors. I am running a command in a bash shell. I want to redirect output to append to a file that ...
0
votes
0answers
121 views

mutt client: Not able to save sent messages in “Sent Items” folder

I have configured mutt as the mail client to send the mail using Linux command line. I have configured the mail client by saving the configuration in the .muttrc file. I am able to retrieve all the ...
1
vote
1answer
38 views

Nested substitution in ZSH

I use zsh. Say, for instance, that I want to remove the current directory from cdpath. That means that I need to remove an element based on content, which fits the ${name:#to_be_removed} pattern ...
0
votes
1answer
172 views

Use the ascii code of a character as an input to sort

I'd like to sort a file with a specific delimiter (ascii 0xff) and the records are zero-terminated. I cannot use the following command though: $ sort -z -t \xff -o data data The error message is: ...
3
votes
2answers
3k views

Unknown ruby interpreter version

I have a MacBook Pro, running Mavericks, but I'm not too acquainted with its inner workings. I'm just a humble CS student. After installing Ruby 1.9.3 and Rails 4.0.0, I get this annoying message ...
1
vote
2answers
139 views

How to insert bash scripts inside the PS1 variable

I made a custom PS1 variable, which is a tremendously confusing. Here is the one that is closest to being fully working: PS1="\n[\e[1;31m]\u@\H[\e[35m] \@ [\e[32m] PWD: \w [\e[1;34m]This folder ...
3
votes
3answers
739 views

Why do people source bash_profile from bashrc instead of the other way round?

It sounds like most terminal emulators don't run local sessions as login by default, so they'll load bashrc rather than bash_profile. So why do most people put everything in bash_profile and have ...
0
votes
1answer
17 views

Linux - Render Special Shell Characters Literally

I'm attempting to connect to a local Windows share via samba with my credentials. the password I am using to connect contains a exclamation point. When I run this command, the shell inputs the last ...
0
votes
0answers
159 views

Cygwin can't execute Shell script

I am trying to execute a Shell script using Cygwin. When I type this in the Cygwin terminal: sh build-native.sh I get this: build-native.sh: line 2: ndk-build: command not found It's a script ...
0
votes
0answers
27 views

How do I determine whether a program other than bash is running in a different pane in tmux, and if so suspend it and return to the shell temporarily?

I am trying to write a bash script to script tmux and do things in every pane in my current window. That I have down, but I'd like to be able to know if another window is running the shell or if I'm ...
0
votes
3answers
205 views

How to delete all hidden .swp files from terminal

How can I delete all .swp files? I tried rm *.swp but I got rm: *.swp: No such file or directory rwxr-xr-x 16 teacher staff 544 Jan 17 13:19 . drwxr-xr-x 19 teacher staff 646 Jan 16 12:48 ...
1
vote
1answer
64 views

Prevent braces in BASH to create sub-shell

I need braces to specify evaluation priority of expressions, but I don't want braces to create sub-scripts. Look what happens when that example code is ran: Example script #!/bin/bash false || ...
2
votes
2answers
790 views

Linux: How can I delete all files whose file name is more than X characters in length?

I want to delete all files in the current directory and sub directories whose file name is more than a particular length. Is there an easy way of doing this from bash?
3
votes
2answers
735 views

Shell script running from cron not running python

I have python program, I want to run it everyday with different variable (on CentOS server): #!/bin/sh /usr/bin/python /root/testing/test.py --variables /root/testing/daily/test1.txt while [ $? != 0 ...
0
votes
0answers
11 views

How to create a pane with a height of 1

I'm writing a bash script that uses tmux. In it, I want to create a pane wioth a height of 1 line. I tried doing tmux splitw -v -l 1, but that just gave me a pane with a height of 2. I also tried ...
1
vote
1answer
19 views

Forwarding shell to servers without installing it

is there any way how to forward a shell to a server without installing it on that box? This is what I need to do: I work for company where we admin X boxes and I will probably not be allowed to ...
0
votes
1answer
154 views

Save session using shell command in KDE

I can save my KDE session using the KDE start menu. But how could I achieve to save my session by shell command ?
0
votes
0answers
37 views

What is wrong with this configuration of sudoers file?

I have to execute a shell script as another user, but without be prompted for password. I've edited the etc/sudoers file with visudo, adding the following line. _www localhost=(otheruser) ...
0
votes
1answer
39 views

Supressing backup files in a ls command not working

How do I suppress backup files displayed in ls? I've already tried - ls --ignore-backup and ls -B Neither suppress the back-up files created by the editors. Am I doing something wrong? or Is there ...
0
votes
1answer
44 views

Trouble 'generating' bash aliases

In my ~/.shortcuts, I have symlinks to some frequently used directories. In .bashrc (OS X), I am doing this: ls -1 ~/.shortcuts | xargs -I {} alias {}="'cd -P ~/.shortcuts/{}'" When I run alias in ...
1
vote
0answers
50 views

In the Open Firmware shell, how do I get output from ls to not scroll off the screen?

I'm working on a PowerPC-based Macintosh G4. In the Open Firmware shell, I'm using the ls command to show the device tree, but part of the information I need is toward the top of the tree, and scrolls ...
1
vote
1answer
22 views

Building a String of dynamic length - least consuming way?

I want to write a series of the character -, the amount equaling to 50% of the terminal window column size. I already have the column size. Let's say the terminal column size is 30. My desired end ...
-1
votes
2answers
53 views

Is Dropbox a good place for my shell scripts? [closed]

I know the "official" place for my own shell scripts is the $HOME/bin folder. But i would like to use a Dropbox folder instead and then just simply append it to my $PATH. Something like ...
8
votes
1answer
634 views

why doesn't a bash while loop exit when piping to terminated subcommand?

Why doesn't the command below exit? Rather than exit, the loop runs indefinitely. While I discovered this behavior using a more complex setup, the simplest form of the command reduces to the ...
0
votes
1answer
36 views

Find and add/replace kMDItemKeywords attribute OS X

I'm trying to find files (images) tagged with a specific tag and add (possibly replace) it with a new one. Right now I come up with: mdfind -0 -onlyin '/Volumes/HDD_MED_201304/Photos' 'sampleTag' | ...
0
votes
1answer
727 views

How can I keep Classic Shell start menu in Windows 8.1 for every reboot?

I have Classic Shell installed, but Windows 8.1 installed its own Start Menu. It really sucks. I tried to use it, but I miss the list of most recently used apps, just typing to find the program I want ...
0
votes
1answer
154 views

chsh doesn't change shell

I'm using CentOS 6.5, and the chsh command does not work. I've tried under my account and as root, each time using both the full argument chsh -s /bin/tcsh and using just chsh and following the ...
0
votes
1answer
68 views

Log in using SSH without password

On my server, I've got openssh-server and a special account without password. I'm creating a shell script, that must be used without user input. For example $(ssh dummyUser@dummy.com) I need script ...
0
votes
1answer
131 views

SSH shell on a multicore supercomputer [closed]

I created a program on my 2 core laptop and I want to verify how my program performs when more than 2 cores are available for processing. Do anybody knows any free (or cheap) service where I can ...
2
votes
1answer
227 views

Shell: how write multiline text file without escaping special symbols?

I know the question sounds to be discussed thousands times before. But somehow I can't find good solution. Problem: I need to write multiline text from shell. The text might contain special chars ...
0
votes
1answer
68 views

Bash two text files comparision script

Given two files, I want to write a shell script that reads each line from file1 and checks if it is there in file2. If a line is not found in file2 it should keep it lets say in a table TAB1. Also, if ...