0
votes
1answer
24 views

sh + how to run command and set it into parameter ( VAL )

please take look on the following commands down, ( the shell is sh ) something not clearly for me when I run - eval echo \$arr$n , I get the value a as expected so why: VAL=eval echo \$arr$n , ...
0
votes
2answers
79 views

Getting errors trying to run shell script (Linux)

I'm trying to run the following script. I have run it before without issue, but now I encounter an error. #!/bin/bash # init function pause(){ read -p "$*" } echo & echo "(Website):" ...
0
votes
0answers
7 views

Trying to find dbus session, doesent work

Trying to use notify-send with cron, it needs dbus, what im i doing wrong? var= $(set | grep '^DBUS_SESSION_BUS_ADDRESS=') export DBUS_SESSION_BUS_ADDRESS=$var #!/bin/sh { ...
0
votes
0answers
15 views

Make a script identify DBUS session address and use it

I'm using cron with notify-send to display some notifications, but it requires DBUS session to run Here is the script: export DBUS_SESSION_BUS_ADDRESS=[session] #!/bin/sh { DISPLAY=:0 ...
-1
votes
2answers
25 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 ...
0
votes
0answers
26 views

Idle timeout Bourne-style shell

Is there any way to timeout idle users in Bourne-style shell (/bin/sh). man sh does not talk about it. http://www.freebsd.org/cgi/man.cgi?sh TIMEOUT or TMOUT shell env variables in /etc/profile ...
-1
votes
2answers
77 views

How can I change the “/” path in linux [closed]

When I type cd /, it changes my directory to a default one. How can I override the current settings so that / points to a different directory.
0
votes
2answers
24 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 ...
1
vote
0answers
169 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
57 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 ...
4
votes
4answers
132 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
119 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
59 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 ...
2
votes
2answers
14k 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 ...
1
vote
1answer
438 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
116 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 ...
2
votes
2answers
357 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 ...
1
vote
1answer
471 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
234 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
1k 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
1answer
730 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
2answers
583 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 ...
4
votes
3answers
7k 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
488 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
696 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
397 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
362 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
554 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
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 ...
0
votes
1answer
437 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 ...
17
votes
3answers
24k views

Which command in the Linux/UNIX sh shell returns my current directory?

Using the sh shell (not bash), which command in Linux/UNIX prints out my current directory? $ *showmewhereiam* /sys/kernel/debug $
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/
75
votes
4answers
74k 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
1k 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 ...
9
votes
3answers
2k 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 ...
8
votes
2answers
707 views

Making bash TAB completion more like cmd.exe [duplicate]

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
9
votes
2answers
22k views

What exactly is the sh command?

I can't figure out what the sh command is? http://unixhelp.ed.ac.uk/CGI/man-cgi?sh Does it execute a file? like in tomcat: sh /usr/local/tomcat/bin/shutdown.sh Sorry, just confused.