The sh tag has no wiki summary.
-3
votes
0answers
20 views
Wafku won't start
I happen to install Wakfu with a SH file but somehow doesn't seem it wants to start up, "I don't know if has to do with my graphic cards" any suggestion what it can be?
0
votes
1answer
31 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 ...
0
votes
1answer
61 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
62 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
31 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
133 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
122 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
55 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
231 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
65 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 ...
1
vote
4answers
117 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
195 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
80 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
211 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
1answer
307 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
104 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
2answers
246 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
281 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
141 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 ...
2
votes
2answers
2k 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
277 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
336 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
162 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" ...
-2
votes
1answer
139 views
Recursively delete a line from JS files [closed]
Please help me with writing a shell script that deletes line from virus JS files recursively.
String to remove: http://pastebin.com/ExjCK8GL
0
votes
1answer
570 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
241 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
82 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
178 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
171 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
154 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
245 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
717 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 ...
1
vote
3answers
409 views
Renaming a file from myFile.sh to myFile.bash?
PART 1
Ok so i'm using Mac and I started out with a file called...
Example: myFile.sh
In Terminal I ran this file in its directory by typing...
bash myFile.sh
That works perfectly, but then I did ...
1
vote
1answer
705 views
sh alias: command not found
I have written a very simple script like this:
function apply_to_dev {
echo "Applying scripts to DEV..."
alias ISQL="isql -Uuser -Ppwd -SDEV -DDATA -I ~/bin/interfaces"
shopt -s nullglob
...
2
votes
1answer
218 views
sh on Lion can't cd into folders with implicit paths (causing make to fail constantly)
I've had a problem with my OSX 10.7 Lion install for some time and I finally took some time to investigate.
The issue is that when running make, I always get an error of the form:
/bin/sh: line 0: ...
2
votes
2answers
168 views
Screen does not appear in list when using sudo
While under root user (printed by whoami), execution of
sh -c "screen -d -m -S testscreen sh -c \"echo asd; echo qwe\""
creates a screen with two lines output, which can be reattached via screen -r ...
0
votes
1answer
287 views
How to configure using arrow key to repeat previous shell commands in Minix
I am new to Minix. I'm so impressed by the speed of the system. It looks elegant, I like it.
However, I have a question about the shell. In Linux, while using a shell, up and down arrow keys can be ...
5
votes
3answers
125 views
CD into directory with “-” in the beginning
I have a problem with cd-ing into folder named "--Recovery Files" and can't remember how to escape dashes in the filename. Any ideas?
2
votes
2answers
356 views
Log Files from bash script output
I have a script that runs (this works fine).
I'd like to produce logfiles from its output and still show it on screen. I have this command that creates three files from this blog:
((./fk.sh ...
12
votes
3answers
10k views
How to find out which directory I am in in Linux?
Which command in Linux/Unix prints out where I'm in? (Using sh not bash)
$ *showmewhereiam*
/sys/kernel/debug
$
2
votes
2answers
437 views
How run sudo -s after ssh login
My Step By Step:
On myserver.com i paste line "sudo -s" to file "~/.bashrc" in home directory for "mylogin"
SSH Login to mylogin@myserver.com
After login:
root@myserver.com:~$
But, press cntrl+D ...
1
vote
5answers
1k views
How to run .sh file
I am using Ubuntu and just downloaded the jmonkey game engine. Everything appears to be in a single .sh file. I am not really sure how I am supposed to run this.
http://jmonkeyengine.com/
0
votes
4answers
695 views
/bin/sh source from stdin (from other program) not file
Kind of a tricky one to name this...
Basically I have a program which when run prints on STDOUT a set of shell variables:
$ ./settings
SETTING_ONE="this is setting one"
SETTING_TWO="This is the ...
22
votes
3answers
21k views
How can I resume a stopped job in Linux?
How can I resume a stopped job in Linux? I was using emacs and accidentally hit ctrl-z which blasted me back to the console. I can see it when I type 'jobs'
[*****]$ jobs
[1]+ Stopped ...
0
votes
1answer
951 views
How to check for program exit code in Linux?
I want to check in a shell script whether subversion is installed.
For that I chose to check the exit code after the program has been executed.
I tried using command svn, but that prints out the ...
6
votes
2answers
1k views
Comments in a multi-line bash command
This single-command BASH script file is difficult to understand, so I want to write a comment for each of the actions:
grep -R "%" values* \
| sed -e "s/%/\n%/" \
| grep "%" \
| grep -v " % " \
| ...
5
votes
3answers
824 views
How is install -c different from cp
What is the difference between install -c and cp? Most installations tend to use install -c, but from the man page it doesn't sound like it does anything different than cp (except maybe set ...
7
votes
2answers
435 views
Making bash TAB completion more like cmd.exe
I wondered if theres a way to do rotational style completion in bash similar to the behavoir on cmd.exe, I've found it speeds me up in regard to entering commands
1
vote
3answers
210 views
Read everything that has been echo'd and 'errored' to terminal window?
I've inherited a complex shell script running on OSX that gets run on a crontab.
Within the script I would like to periodically read everything in the terminal window and write it to another file... ...
1
vote
2answers
916 views
What happens to the environment when you run “su -c”?
What happens to the environment when you run "su -c"?
The reason I ask, is this mysterious behavior:
bash$ which firefox
/usr/local/bin/firefox
bash$ su - user -c "echo $PATH"
...
