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
2answers
48 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
44 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
21 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
80 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
1answer
440 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
70 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
213 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
16 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
62 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
25 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
84 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
43 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 || ...
1
vote
2answers
202 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
143 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
8 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 ...
0
votes
1answer
13 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
32 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
25 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
27 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
39 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
23 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
18 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
52 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
319 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
21 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
0answers
429 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
44 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
58 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
100 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 ...
1
vote
1answer
83 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
52 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 ...
0
votes
1answer
35 views

Terminal scrolling from shell script

Is there any way to perform the effect of using the scroll bar in Terminal.app using a shell command? Maybe something cross-platform, that works in Linux terminal emulators too?
-2
votes
2answers
59 views

What does $@ mean as a bash script function parameter

What does $@ mean asa bash script function parameter? function foo() { echo "$@" 1>&2; }
0
votes
1answer
93 views

Is there anything like iTerm2 + Byobu on Windows?

I'm stuck running Windows as my primary OS at work. I'm trying hard to find a good console environment, but falling short. I'd like to have iTerm2 + Byobu. So far I'm using conEmu with the cygwin ...
0
votes
2answers
30 views

View network locations from Debian shell

I'm trying to see a list of all devices on the network from the shell in debian. The same list you get by typing 'Network' into an explorer window on Windows. Seems like it should be an easy thing to ...
2
votes
0answers
76 views

Downloading and building O3D

I'm trying to get a program called O3D into my computer by following the instructions on O3D's wiki. I tried to download the project to my directory but the prompt gave me this answer: gclient is ...
2
votes
4answers
96 views

Add a display to let user wait in bash

I am looking for a pretty stupid piece of code for bash that will show a kind of "please wait" rolling display, with the characters : - \ | / The first problem is that I don't know the name of this ...
0
votes
1answer
67 views

Vim and the Shell - How close should their bond really be? [closed]

Bridging the gap After years of daily swims in the vast sea of Vim-plugins, ranging from 2-line snippets to full-blown superstar programs, I have observed how a very significant amount of these ...
1
vote
1answer
211 views

Sending Linux commands over serial connection to an Android device

I have a question about being able to send Linux commands over a serial connection to an Android device. I have heard of PuTTY and tried to use it, but I am ultimately lost with it. I was in the ...
1
vote
1answer
43 views

Why changing directory with `/../` works?

Change directory: $ pwd /usr $ cd bin && pwd /usr/bin With .., same outcome: $ pwd /usr $ cd bin/../bin && pwd /usr/bin But why? Why the shell is not throwing an error?
0
votes
2answers
113 views

Shell function in .bashrc is not recognized

I know this must be something silly but somehow I am stuck trying to create a shortcut (alias) for a shell function. Here is my exact .bash_profile: [[ -s "$HOME/.rvm/scripts/rvm" ]] && source ...
0
votes
5answers
110 views

How to test if a variable is equal to a number in shell

I have this shell script that isn't working. Input: Server_Name=1 if [ $Server_Name=1 ]; then echo Server Name is 1 else echo Server Name is not 1 fi Output: Server Name is 1 But, if i ...
1
vote
0answers
70 views

Error while remount a partition read only

I have a rooted HTC and need to create a custom file in /system/xbin. I execute a mount command (for read-write permission on /system), create the file, remount /system in readonly and after that my ...
0
votes
1answer
31 views

Shell command ${PWD/\/$upto\/*//$upto} not understood

I saw a shell function to change dir up to $upto. upto() { cd "${PWD/\/$upto\/*//$upto}" } But I don't understand "${PWD/\/$upto\/*//$upto}". Could any one kindly explain? The function was ...
1
vote
2answers
54 views

How can I replace icons of an application's executable?

I have an application whose executable contains some default icon. Now, I know I can use a shortcut with whatever icon I want, but what I'm looking to do is change the icon without the executable ...
0
votes
1answer
380 views

How to generate a PDF from a series of images?

I have a series of images (a scanned book, actually) that I want to make into a PDF in A4 format. Why I'm doing this: I'm helping a less computer savvy person in a different country to get a printed ...
0
votes
2answers
138 views

How to restrict grep to search only below a token of a column?

How can I use grep to search only the values of a column below a token? For example in the following CSV file: A B C 1 𝟒 5 2 𝟒 0 1 𝟑 6 ...how can I get ...
0
votes
1answer
85 views

Find number in string and replace it

I wrote C++ code and now I want to replace the number in a string by using shell scripts. The part that needs to be replaced: if (random<=90) How I can change the 90 from a shell script? I ...
0
votes
2answers
59 views

sum numbers in different lines in shell

i have 8000 lines similar to this <Flow flowId="1" timeFirstTxPacket="+0.0ns" timeFirstRxPacket="+924100.0ns" timeLastTxPacket="+199984927558.0ns" timeLastRxPacket="+199675473275.0ns" ...
4
votes
1answer
73 views

Shell history support that doesn't suck?

When I use multiple terminal sessions at once, bash only persists the commands from one of them. Then later when I try to do a reverse command search, the command I want is not going to come up, ...