The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
15 views

what cygwin packages do I need to install to be able to run commands from cmd.exe on windows?

I am trying to install JSCover http://sourceforge.net/projects/jscover/files/JSCover-0.2.0.zip/download, I snooped around and figured that to run .sh files on windows easiest option is to install ...
2
votes
1answer
37 views

Redirect stdout/stderr of a background job from console to a log file?

I just run a job (assume foo.sh). ./foo.sh [Press Ctrl-Z to stop] bg # enter background And it generate output to stdout and stderr. Is there any method to redirect to stdout and stderr to other ...
1
vote
0answers
87 views

execl: couldn't exec `/bin/sh'

I accidentally moved the whole bin, boot, dev and etc directory. After moving everything back I get the following error email from various cron jobs: execl: couldn't exec `/bin/sh' execl: No such ...
0
votes
1answer
27 views

How can I encode an url for wget?

I am looking for a way to convert a string to a clean url. For example : wget http://myurl.com/toto/foo bar.jpg This is going to download http://myurl.com/toto/foo and http://bar.jpg. I want to ...
0
votes
1answer
31 views

Issues with this sh script?

Having issues executing this sh script...i don't see anything wrong with it, does someone else see something I screwed up? echo "**************************************" echo "*** ...
0
votes
1answer
28 views

Is there a way to pass a statement via an argument in shell?

What I'm trying to achieve is to set the title of a widget when computer goes to idle: xsidle.sh echo mywidget.title = "idle" | awesome-client when i remove xsidle.sh it works flawlessly. xsidle.sh ...
0
votes
1answer
130 views

Why do I sometimes get 'sh: $'\302\211 … ': command not found' in xterm/sh?

Sometimes when I simply type a valid command like 'find ...', or anything really, I get back the following, which is completely unexpected and confusing (... is command name I type): sh: ...
1
vote
1answer
50 views

bash says '[[:' not found. what does that mean?

While running a bash script, I get this error: sh: [[: not found How can I find what where is the problem?
1
vote
3answers
52 views

Enter a string containing “!!” on a shell without it being interpretted

I'm trying to send a string that contains "!!" in it. However, every time I execute it on zsh, zsh replaces !! with the last command entered. How can I get zsh to not interpret "!!"? I have also ...
1
vote
1answer
666 views

Why does subshell not inherit exported variable (PS1)?

I am using startx to start the graphical environment. I have a very simple .xinitrc which I will add things to as I set up the environment, but for now it is as follows: catwm & # Just a basic ...
0
votes
3answers
120 views

Write pipe result to variable

I need to be able to write whether the test for a grep is either TRUE or FALSE to a variable so I can use it later For the following, if I run defaults read com.apple.Finder | grep ...
0
votes
1answer
315 views

useradd denies home directory creation Ubuntu 13.04

I'm trying to set up a git user, but am getting the error useradd: cannot create directory /srv/data/git when running this command sudo useradd \ --create-home ...
1
vote
2answers
45 views

Easiest way in Bourne shell to extract strings from a line of text?

Let's say I'm doing a grep and it returns this line: Invalid value (48) on line 3 How can I easily pull that value 48 into a variable in Bourne shell?
1
vote
2answers
858 views

Change the sudo su shell

Whenever I run sudo su from my normal zsh (which uses the oh-my-zsh framework), I'm forced to use the old Bourne shell (sh) by default (obviously; this is standard behaviour on most *nix-like ...
4
votes
4answers
115 views

How can I find a path by providing only part of the path?

Let's say I need to find this path /<some_where_in_root>/find/this/path and the only information I have is /find/this/path. What would be the best means of locating the full directory? I ...
0
votes
1answer
109 views

service started from sh script stops when sh script

I have service named "router" that is able to receive http requests. I decided to write sh script that will periodically check health of router service. if something is wrong then it will restart it. ...
1
vote
1answer
54 views

SSH parameter help on Ubuntu Server

I have a variable setup like this: SSH_EXEC="ssh -X -o ControlPath=~/.ssh/master-$$ -o ControlPersist=60" The parameter in question is the -X, because if I then call this command within my local ...
0
votes
1answer
80 views

Automatic autorestart Firefox on close

I want firefox to restart automatically when I close it. I found this script #! /bin/sh while [ true ]; do firefox done and I put a file with that script in the /etc/init.d folder. Firefox ...
2
votes
1answer
225 views

How to compare files in different folders in Unix?

Following is the directory structure Folder1 subFolder1 File1.txt File2.txt subFolder2 File3.txt subFolder3 Folder2 subFolder1 File1.txt File2.txt ...
1
vote
2answers
9k views

How to display current path in command prompt in linux's sh (not bash)?

I would like to display current path in sh prompt (not bash shell), which currently just shows "#", I tried with introducing this env PS1="$(whoami)@$(hostname):$(pwd)" and set ...
0
votes
1answer
62 views

How to make an alias and work in sh for all users (not in bash)?

My question maybe is silly, but how can I make an alias so as to work in sh for all users? I know that I can put an alias, let say this one: alias ls='ls -l' in /etc/bash.bashrc so as to work in ...
1
vote
1answer
344 views

Linux: How to eval the contents of STDOUT?

Consider you have a file with some sort of terminal command. How might each line be executed? Can you pipe the output of more into an eval? %> more ./foo.txt Edit: After some help/guidance ...
0
votes
1answer
186 views

Crontab doesn't run my script Ubuntu

My script is located in /opt/restart-hlasic.sh restart-hlasic.sh contains: #!/bin/bash SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/ SERVER="XXX" ...
0
votes
1answer
97 views

Upstart event when network connectivity to a specific server is available?

Is there a way in upstart to code an event to start when network connectivity to a specific machine becomes available? Something based on a ping result would work in my case. The task being started ...
1
vote
1answer
464 views

How to force a longer `reboot` in Busybox v1.13.3?

reboot appears to make the root file system read-only almost immediately, causing a race condition with one of my processes which tries to write settings out to a file during its approx 1-2 second ...
2
votes
2answers
323 views

Allow any user/password entry in ssh

I want to setup ssh so that one can login with any username or password and be accepted. If they chose a username and password of an actual user on the system they will successfully login and use ssh ...
0
votes
2answers
80 views

Equivalents for .bat files for starting a jar file

Which are the .bat file alternatives for Linux, MacOSX and other operating systems for starting a jar file for example or another program (.exe, .app ...) with a click on this .bat / ... file? I just ...
1
vote
1answer
435 views

how to read data from a file in shell script

I have two shell script files test1.sh and test2.sh . I have another file called translogs.txt. Now I need to copy the values of two variables in test1.sh to translog.txt and the same variables need ...
0
votes
1answer
209 views

Bash: Copy logs to other file and remove copied log

I am using linux and doing some bash scripting. I have a log file which is making logs of all the events/changes our in particular directory. I need to copy these logs to some other file so that I can ...
2
votes
4answers
855 views

How do I start in bash when ssh'ing into my server?

I have a hosted Debian server. When I log in via ssh, I'm greeted with a sh environment. How do I change it so I start in a bash environment?
2
votes
3answers
1k views

How can cat/print a file except the last 2 lines?

How can get a file, except the last (for instance) 2 lines, with standard or GNU shell tools? (bash, tail, cat and so on.)
0
votes
1answer
117 views

I changed the symbolic link /bin/sh by accident

I am working on Ubuntu 11.1. The symlink /bin/sh pointed to dash in my system. /bin/bash pointed to sh. I accidentally changed /bin/sh to point to /bin/bash. Now, I can't open the terminal. How can I ...
2
votes
1answer
655 views

execvp exec format error for shell script on Red Hat Enterprise Linux 6

We have two RHEL 6 systems that are running identical versions of the kernel and glibc (glibc–2.12–1.90.el6_3.6). According to the POSIX standard and the Linux man pages, if the kernel determines that ...
0
votes
3answers
2k views

Make .sh file executable

I have a .sh file which is not becoming an executable. I tried doing it in the properties but as soon I ticked the checkbox, the tick vanished in a second. I then tried sudo chmod +x filename.sh ...
2
votes
1answer
169 views

Record bash_history to private database for all users?

I want to be able to setup a MySQL database and record all commands issued on my server by username and command. Is this possible, and if so, how would I set it up?
1
vote
3answers
355 views

How to find out environment variables set after logging into a shell session

How can I find out the environment variables set after logging into a shell session? My two dummy solutions have been so far as follows: _VariableName1="VarValue1";export _VariableName1; ...
0
votes
2answers
516 views

Get back to the default terminal in debian

I've accidentally press the key Ctrl + Alt + F1. It switches my default terminal to a virtual terminal, and I don't have the folder and user information in the command line anymore. How do I get back ...
1
vote
1answer
271 views

“Undefined variable” error in shell script on Sun Grid Engine

I have the following Sun Grid Engine submission script: #!/bin/sh # sun grid engine cluster # use current working directory #$ -cwd # merge error output into standard output stream #$ -j yes #$ -o ...
4
votes
3answers
6k views

How do I change my default shell to bash if I don't have access to chsh nor /etc/passwd?

I'm working on a university remote Linux account, and the default shell is sadly csh without tab completion. How can I change my account's default shell to bash? chsh is not available.
1
vote
0answers
460 views

using screen with start-stop-daemon, sysv

I'm trying to run a program with an ncurse interface as a daemon using screen. I want to use start-stop-daemon to manage the process, but I'm having trouble creating a SysV init script. Variables: ...
0
votes
2answers
626 views

How to use sudo with rcp command to copy files from linux host to HP-UX host?

I'm having this issue where when I try to use sudo to rcp some files from a Linux host to an HP-UX host (note that the destination directory requires root access to write to), I get the following ...
2
votes
2answers
355 views

Is there a way to remove root requirements for a specific command in linux? If yes, how so?

I'm using Ubuntu 12.04 LTS, and I'm trying to make it so that the specific command dhclient doesn't require root privileges. I've done some research that leads me to believe I could unlock an "su" ...
0
votes
1answer
910 views

sh: time command not found

In llvm 3.0 test-suite, the snippet of code bellow gives the following error on bash: sh: time command not found if [ "x$RHOST" = x ] ; then ( sh -c "$ULIMITCMD $TIMEIT -p sh -c '$COMMAND ...
2
votes
1answer
346 views

How to set-up date for cron weekly backup?

I'm writing a command for cron to do automatic backups for my flashdrive. I use tar ... -N <some date> to make the backup. The issue is how to write the command which gives me the right date. ...
0
votes
1answer
112 views

Python script takes string args with './[];' — Tell terminal to process as literal input?

My script takes a key as its third argument, and it can have any kind of input...including characters that bash complains about. I'd really like to use this one-off script right from the terminal, ...
0
votes
0answers
219 views

bash script rm cannot delete folder created by php mkdir

I cannot delete folder created by php mkdir for I in `echo $*` do find $I -type f -name "sess_*" -exec rm -f {} \; find $I -type f -name "*.bak" -exec rm -f {} \; find $I -type f -name ...
0
votes
1answer
240 views

Loop until user presses 'C' in sh file

What I want is as follows: At first when user runs .sh file it displays following: Review id: You id is:XXX000YYY Do you want to change it?[Press Y to change, C to continue]: Now If user presses Y ...
0
votes
1answer
521 views

Symbolic links for directories

Really need a quick help on this. This is the scenario. Created source directory SOURCE : /apps/application_scripts/intl/bin Here I have lot of shell scripts (*.sh) TARGET : ...
1
vote
1answer
434 views

Background Jobs from cron

I am running a cron on every two minutes. From the cron I am running other shell scripts in background with "&". After cron exits spawned shell script process still runs, this is desired behavior. ...
1
vote
1answer
1k views

Run SH Commands in Background

I have a bunch of scripts that I need to run to start up a couple Node.js scripts and Mongo, among a couple other things. I'd like to create an SH script that I could run to start ALL of these at ...