-3
votes
0answers
15 views

Why does windows not come with a Bash shell? [on hold]

A bash shell is a pretty standard feature of a modern operating system but it is not part of Windows? Missing this is like missing a internet browser and makes a huge portion of work impossible. I ...
0
votes
1answer
5 views

Tried Installing ZSH through cygwin and then trying to use zsh through Cmder

I tried to install Cygwin (64 bit version) on my computer, and it went through hunky-dory until at the very end, autorebase.bat failed with exit code 1. I read through the logs and they weren't too ...
0
votes
1answer
7 views

psql ignores my PAGER variable

I want to use less as my default pager. Therefore I have PAGER=less in my .bashrc. It's sourced properly: $ echo $PAGER less However, psql still uses more if I call it with psql. BUT: If I call it ...
0
votes
4answers
40 views

How to rename a lot of files in bash shell?

Sorry for the question. I searched the internet a lot, but couldn't find an answer which worked (though there were a lot of suggestions). So, I want to rename A LOT of files. Writing all file names ...
0
votes
1answer
17 views

stop all child processes when 1 of then returned exit code 1

I have 2 or more build processes to run in background. I want to stop all the build processes if one of them exit with code other than 0. ./build-1.sh & ./build-2.sh & ./build-3.sh & wait ...
0
votes
0answers
19 views

Access script arguments from within script [duplicate]

I have a script that I can run like this: bash myscript.sh -ram 4096M -jar something.jar -dir /home/something I would like to be able to access the variable ram, jar, and dir from within the script. ...
0
votes
1answer
29 views

CentOS 6 - Send user defined command from PHP

I have a web control panel and I need my allow my users to send commands to their application. I a similar problem to SQL injection. $user_input='good command'; shell_exec('tmux send-keys session1:0 ...
1
vote
1answer
25 views

Batch convert txt file encoding

I have about 700 files that were the results of a closed caption software process. I can open the files on my PC or Mac in a GUI, but when I open it on the server with nano, I get this: ...
1
vote
1answer
27 views

Different globbing behavior with same shopts?

I have multiple shells (bash) open on the same machine, and in one of them, globbing seems to have stopped. ls * gives ls: *: No such file or directory, and so on. I figured that I must have set some ...
0
votes
0answers
10 views

mc-wrapper does not exit to MC_PWD directory

I recently installed openSUSE 13.1 and set up the mc in typical why by aliasing mc with mc-wrapper.sh to have it exit into the last working directory in mc instance. However this does not seem to be ...
0
votes
2answers
59 views

Is it possible for a root user to watch others' shell session secretly in live?

I see a similar question on stackoverflow: http://stackoverflow.com/questions/1353253/linux-terminal-how-to-capture-or-watch-other-terminal-session Someone recommends conspy. However, it seems that ...
0
votes
1answer
24 views

Bash doesn't source file unless manually started

bash won't source files from an login terminal unless I manually run bash from a terminal, I have bash (and not sh or dash). When I source a file, it returs errors (like "syntax error near unexpected ...
1
vote
2answers
38 views

Execute a previous command in a shell and get the command directly after

Once, a colleague of mine shown me a very useful method (shortcut?) on a shell (bash? csh?) to, after executing a previous command, automatically show the command after in history. For example, ...
-1
votes
1answer
31 views

Using /usr/bin/env to change directory [closed]

I want to automatically execute commands with the prefix /usr/bin/env $/usr/bin/env composer install (this runs OK) $/usr/bin/env cd public (failed ---> /usr/bin/env: cd: No such file or ...
0
votes
0answers
21 views

Running Custom commands in a Terminal Application

I am running a terminal application in /dev/pts/X terminal that has its own console as sampleapp> what I need is to run commands specific to this application but from another terminal.
0
votes
2answers
18 views

Piping Several commands in a BASH shell

I am trying to recursively loop through a directory which contains numerous other directories and files and then find all the .rb files and copy them to another directory. This is what I have so far ...
-1
votes
1answer
23 views

how to escape '$' in an awk statement in shell alias

I'm trying to write an alias that will kill all running php processes.. this is the command i got in my ~/.bash_profile alias killphp="ps aux | g [p]hp | awk '{print $3}' | xargs kill -9" this ...
2
votes
2answers
44 views

How do I handle multiple quotes in an alias (for bash or zsh)

I am using zsh, and I am trying to use python as a simple calculator. I'm very familiar with python, but can't seem to get the alias (or function) to work properly. So far I've got: pycalc() { ...
0
votes
1answer
31 views

Skip keychain without skipping the rest of .profile

I am using the keychain ssh-agent wrapper from funtoo.org. I have it loaded automatically by adding an eval line in my .profile. E.g.: eval `keychain --eval id_rsa github bitbucket` Sometimes, I ...
0
votes
0answers
12 views

How to prevent MacVim from inherenting .profile as if it was Bash itself?

I have this guard in my .profile: if [ -n "$BASH_VERSION" ]; then if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi if [ -f "$HOME/.bash_aliases" ]; then . ...
0
votes
1answer
16 views

Why doesn't __git_ps1 work in bash anymore on OSX with MacPorts?

After updating Macports today, I get -bash: __git_ps1: command not found. Why is that?
0
votes
1answer
48 views

/dev/zero or /dev/null for redirect?

I understand that the standard to redirect to is /dev/null, but why not use /dev/zero? Does it not have the same effect? Another question, what do all the 1>> 2>> &>> ...
0
votes
1answer
24 views

Change value in config without opening

Is it possible to change/uncomment value in linux configs without opening and go to line? Example: In php.ini we had expose_php = On and we want turn it off: $: magic_cmd "expose_php = Off"
0
votes
1answer
30 views

Search a string between two timestamps starting from bottom of file

I was trying to find a string Cannot proceed: the cube has no data in huge test.txt file only between timestamps yesterday 22:30 pm to today 00:30 am. Script: tac test.txt | awk -v today=$(date ...
1
vote
0answers
29 views

Recursive search occurs instead of last command when using up arrow.

I'm using an internal product "shell" based on spring shell. When I press the up arrow to get my last command, instead I get (reverse-i-search)`': Retrieving the last command works for all my ...
2
votes
3answers
180 views

What exactly do the sudo -s command? and how is it used in this example?

I have the following doubt. In a tutorial related to a software installation that I am following say that I have to execute the following commands (I am doing it into an ssh shell, so this list of ...
-1
votes
2answers
27 views

What is the risk when editing crontab file without the “crontab -e” command?

I developed a script in which I add lines to the crontab file with echo command and I remove lines with sed command. I do not know the risk of that especially that I find in some web site that we ...
1
vote
2answers
75 views

Use alias source with relative path

I want to add an alias file to my project folder to quickly open and edit files in it with a simple shell command. To make it more portable, I would like to use only relative paths. I want something ...
0
votes
2answers
38 views

Using a parameter multiple times in a single line bash command [duplicate]

I occasionally need to run a command such as: mv "very-long-file-name.x" "very-long-file-name.y" I would like to achieve this without repeating the very long file name twice... I know how to do ...
1
vote
1answer
43 views

Bash script to check for shell access

I am working on a shell script to easily manage accounts. I want to have an option to enable and disable shell access (which is easy) but the tricky part is finding if an account already has shell ...
0
votes
1answer
60 views

Execute the shell command in subshell or in background?

Actually I mainly work with Ruby, but now I have created a bash script file. From this script file I am displaying the messages on the screen. Here is my scenario. I have used aosd_cat module for ...
0
votes
2answers
106 views

How to automate shell script to run when I open a particular app in OSX?

I've been running into a rut recently with one project I've been trying to accomplish. Using Automator, but I don't know how to exactly to go about this project. There's this script editing app called ...
0
votes
1answer
48 views

How do I call function after prompt for input in a Linux shell script?

The title says it all. After Im prompted, I want yes and no to respectively call a function. # Check to see if you ran this script before echo echo I need to know if this is your first time... while ...
0
votes
1answer
84 views

Shell script to check all the URLs from a file or list

I'm looking for a shell script to check a list of URLs and give output. For example: http://abc.com/index.php http://abc1.com/index.php I may place them in a separate file or inside the script. I ...
0
votes
1answer
31 views

get a command process back after closing a session

Arrrgh! I'm using one of those drop down shells (guake, I think) on Linux. I'm dd-ing an SD card, and I accidentilly closed the shell session that was running that command. The light is still ...
0
votes
2answers
26 views

Copy shell configuration from one machine to another?

I've got login to another server where shell configurations are not like I would want. For example I don't see my username and CWD on prompt, and when I press arrow key, instead of giving last entered ...
0
votes
1answer
30 views

How to use find to fill in variable in Shell script

I am making simple Shell script form some boring-ever-repeating job. Script changes directory correctly, and now I want to run other scripts based on argument I typed when running script. Other ...
0
votes
0answers
24 views

How to rewrite bash shell script to nyaos script

I'm using this small shell script named zip0 in linux environment. #!/bin/bash zip -0rq "${1}.zip" "./$1"; I also want to use this function in windows nyaos script. By direct input from shell $ ...
0
votes
0answers
34 views

How to open a local file with a query string appended to it in the default browser?

I want to do something like this from a shell script: $ open 'foo.html?foo=bar' Sadly that fails, as it looks for a file named foo.html?foo=bar instead of foo.html before opening the browser: The ...
0
votes
1answer
58 views

email command not working in UNIX Linux

I tried with 2 email UNIX commands mail and mutt from my Red Hat Linux box. It's not sending any mails to the email id I specified. echo "My message" | mail -s subject "test email" <my valid ...
3
votes
1answer
70 views

Why does my .bashrc get read when I run noninteractive commands over ssh

I've prepended each of my bash config files (~/.bashrc,~/.bash_profile,~/.profile) with echo NAME_OF_FILE, i.e. I get '.bashrc' when I source in ~/.bashrc. What baffles me is why I get and ...
1
vote
1answer
22 views

How can I restrict a bash find to only specific sub-sub-directories

I'm trying to list all the files in a specific sub-directory but different directories which are themselves on a different volume. The following works, but only on a fully specific sub-directory (and ...
0
votes
0answers
45 views

Autoexport bash internal variables

I need to access to some bash internal variables (BASH_LINENO, BASH_SOURCE) from a command invoked by a shell script. The only possible interface between my command and the script are environment ...
1
vote
1answer
219 views

How to rename the file name with timestamp of created date by JavaScript, Perl or shell on OSX?

Could you tell me how to get timestamp of created date of file and rename the file name with it by JavaScript, Perl or shell on OSX 10.9.2? Example: Existing: Untitled.txt timestamp is 2014/05/03 ...
0
votes
2answers
87 views

How to continue running a program in bash

I have made a bash program in Ubuntu. The program is "rock, scissors paper with computer". I want to continue this program until the message "you win, bye bye". Could anyone suggest a method for me ...
0
votes
0answers
40 views

Specific command not recognized in only one shell

I'm running Windows7 as OS as my development machine. It has various Shells: cmd Powershell Mysysgit GNU Bash <-- this is the one not working PuppetLabs Shell Nodejs Shell PHPStorm built in ...
0
votes
1answer
57 views

how to change directory in ubuntu

I'm trying to change the directories of a symbolic link. ln -s /usr/local/mysql-cluster-gpl-7.1.5-linux-i686-glibc23 /usr/local/mysql When I type command cd /usr/local/mysql it is giving me error ...
0
votes
1answer
69 views

Color in bash prompt messes up git output

I changed my .bashrc to include export PS1="\033[1;33m\u@\h: \w>\033[0m" so that my shell prompt would be colored, but it seems the \033 messes up git output (log and diff, at least). I see ...
0
votes
1answer
65 views

Choosing shell for xterm in Cygwin

Basically my question is closely related to this one: http://stackoverflow.com/questions/21905380/how-do-i-get-cygwin-xterm-to-use-bash-and-not-sh I also want to set bash as the default shell for ...
0
votes
1answer
19 views

alias can't find a file that actually exists

On my personnal computer, not a server, in my .bash_profile (I'm on OSX) — sym-linked to .bashrc, I have the following line among some others : alias deploy=sh ~/dir/ectory/deploy.sh The file ...