The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
3answers
8k 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
505 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
728 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
415 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
1k 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
373 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
122 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
225 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
262 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
572 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
501 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 ...
1
vote
3answers
746 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
948 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
390 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
197 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
449 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
140 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
518 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 ...
17
votes
3answers
25k 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 $
2
votes
2answers
620 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/
1
vote
4answers
1k 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 ...
85
votes
4answers
79k 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 ...
8
votes
2answers
3k 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 " % " \ | ...
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
745 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
1
vote
3answers
240 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
3k 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" ...
9
votes
2answers
23k 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.
3
votes
1answer
411 views

Forcibly break a for loop in sh

If I run a for loop on the command line in sh, and I press control-C, it usually cancels the current running process, so I need to hold ^C until the shell itself catches it and breaks the loop. Is ...
4
votes
2answers
218 views

shell dotfiles and *rcs: what's a sane setup?

A bash user will eventually end up with .bashrc, .bash_profile, .profile, and maybe some more. Now, each file gets loaded unders particular situations, and it all leads to confusion and frustration. ...