A shell is software that lets users interact with the operating system, usually by typing at a command-line.

learn more… | top users | synonyms

0
votes
1answer
37 views

Transferred from -oh-my-zsh to prezto but nothing seems to be working?

Just transferred from oh-my zsh to prezto but I can't seem to get anything working unfortunately. eg presto commands like: prompt -l (to see themes don't seem to work). (I have my .Z----- files setup ...
1
vote
3answers
160 views

how to copy a directory (folder and its contents) to another directory?

Here is my file structure: - someDirA - folderOne - folderTwo - somefile.txt - someotherfile.txt - someDirB - somefolder What I want 'someDirB' to look like: - someDirB - ...
-2
votes
2answers
55 views

Automating Homebrew [closed]

I'm currently using the Homebrew package manager, and I have to say that it is really really great! My question is: there is a way to automate brew update and brew upgrade in order to execute this ...
0
votes
1answer
54 views

Issues running ruby script as cron job

I have a ruby script which i want to run as cron job.It runs perfectly fine when i run through command prompt on a linux machine. But when i run that same script using a cron job it fails. I get ...
0
votes
0answers
30 views

Bourne shell: how to add prefix string to stderr message?

I'm running a script on a Bourne shell, eg not bash (actually the sh from BusyBox 1.23.2). As asked & answered in this question, I'd like to "catch" error messages issued by commands within my ...
-1
votes
2answers
39 views

Echo for status codes?

I'm looking for a tool like echo, but for status codes $ sts 120 $ echo $? 120 I know you can use a sub-shell in a bash-like environment: $ (exit 120) $ echo $? 120 but is there a way to do such ...
-1
votes
2answers
109 views

Create an “IRC shell-account” on private IRC server [closed]

As this question did not receive any informative answers: [ Setting up linux shell accounts for public access ] I would like to rephrase the original question for my own purposes: I would like to ...
-1
votes
4answers
88 views

With KSH, how to convert “12345” to “1.2.3.4.5?”

With KSH, if I have a string 12345 and I want to it be converted to 1.2.3.4.5, how can I do that? I tried to use cut but it's not straightforward. echo "12345" | cut -c1
1
vote
2answers
58 views

Is it possible to start a command on many nodes at the same time?

Is it possible to start a command on 10 nodes at the same time? Here is a portion of my script: #! /bin/sh nb_lignes=`wc -l $1 | cut -d " " -f1` echo "$nb_lignes machines" for i in $(seq ...
1
vote
1answer
33 views

Order of execution of instructions in a script shell

Here is a portion of my script test.sh: #!/bin/bash tar -cf $name.tar $name && pbzip2 $name.tar echo "[$1: Waiting..] Please, i have a question. The execution of the second instruction ...
4
votes
1answer
360 views

understanding some flags in find-command in linux

I wanted to move only files in Linux and I found the answer here as the following: find . -maxdepth 1 -type f -exec mv {} destination_path \; which worked for me perfectly. But my questions are: ...
1
vote
3answers
88 views

How can I get back to last used directory in a Linux shell?

How can I get back to the last directory used on a Linux shell? For example: I open a new shell (or a log in a different console shell) and I write : root@vignesh : cd /root/Desktop This will ...
0
votes
1answer
29 views

Bash shell, associative array empty after piping

Bash 4.3.30 Suppose you have the following code: #!/bin/bash declare -A map f() { map[x]=a map[y]=b } g() { for k in "${!map[@]}" do echo "$k --> ${map[$k]}" done } ...
1
vote
1answer
28 views

Script Shell: Display date of two minutes (period)

I have the following script: #!/bin/sh while :; do sleep 1 date done How can I change this script display the time only of two minutes (period) and exit? Is that possible?
0
votes
1answer
208 views

Running command on Android from host

In order to optimize my work, I want to run commands from my host machine terminal. For example: adb shell sh /data/local/tmp/check_freq.sh The above command runs fine, but some of the commands ...
0
votes
0answers
12 views

Tramp: How can I disable password prompt each time a remote shell is opened?

Each time I run a shell on a remote computer using tramp it prompt me for a password. When mean shell it might be shell or a python process or an ESS process. How can I disable password prompt or ...
1
vote
1answer
166 views

Bash commands in Makefile

I want to use bash commands in Makefile along with MATLAB scripts. Currently when i put a simple bash command in Makefile and run that target, I get error /bin/bash: ./test1: No such file or ...
2
votes
1answer
258 views

Why does ‘tmux’ create new windows as login shells by default?

When you start a new session in tmux or create a new window inside a running session, its default behaviour is to run a shell (ex.: bash) as a login shell. I understand that a login shell is intended ...
1
vote
1answer
56 views

Shell aliases when launching programs from within a Desktop environment (Alt+F2) or window manager?

I'm quite confused about how X runs its programs. As I understand it, much of the environment for programs run by the desktop environment (Gnome/XFCE/i3) is setup (traditionally) in ...
2
votes
1answer
22 views

Killed shell by trying to change shell type which failed to install

I managed to kill all access to the shell by trying to install fish shell via brew and then set the default shell to fish via: chsh -s /usr/local/bin/fish Unfortunately fish doesn’t seem to exist ...
0
votes
0answers
24 views

How to launch a lua server?

I wanted to know how to launch a lua server. I found a game I'd like to play with friends, though we do not know how to start the server that is .lua. The game is here. Could you help us please?
1
vote
3answers
32 views

Script Shell: Delete a line from a file

Here is my file "test.txt": 172.16.68.4 172.16.68.3 Here is my script: #!/bin/sh ip="172.16.68.4" sed '/$ip/d' $1 Please, i'd like to delete a line from test file but it didn't work for me. ...
0
votes
1answer
53 views

yes command replacement unix shell scripting

Is there any command like yes command for Sun OS 5.8? I want to give to write a script which I need to press n continuously, which I want to automate. I tried with yes command but it is not there in ...
-1
votes
1answer
16 views

Command to browse online archives on CLI

Is there a shell command which lets us go through archive like http://archive.apache.org/dist/hadoop/hive/ through CLI ? Some command which lets us perform functions of atleast one of ls and cd, ...
1
vote
1answer
79 views

Command not working on shell but working on prompt

I am a newbie to Linux Shell Script. I want to change the IP address by Linux Shell Script and called by a PHP web application. I have finished my PHP web application and the shell script. Before ...
3
votes
3answers
555 views

How to execute a second condition if the first condition is true in Linux shell scripting

I have an if condition. If that condition is true then one script will be run and after that I need to check another condition. How can I do that using an if statement or something else? For ...
0
votes
2answers
1k views

Running the output of `ssh-agent` in fish; what does `setenv` do?

When I want to start (or restart) ssh-agent, it gives me a few commands that I should run by doing eval $(ssh-agent). Of course this fails for fish, since it gives syntax for bash or csh. The ...
1
vote
0answers
23 views

How to read contents of ATSAM3X8E chip on Arduino Due Board in Mac OS X

I have two Arduino Due boards with some programming that has since been lost. I need to back up the contents before replacing the program. I’ve been playing around with another Arduino Due before I ...
0
votes
2answers
156 views

Loop inside EOF - UNIX SCRIPTING

I am writing a script to automatic start up of an application whenever we found error in logs. so #/bin/bash if [ grep -c 'error' logs -eq 0 ] ;then exit else start <<EOF ## start is a ...
6
votes
1answer
126 views

Why does rsync read .bashrc and not .profile?

rsync is a non-interactive program that logs into other machines. It shouldn't need the init file for an interactive shell session, and it should absolutely need the init file for a login shell. Or so ...
-2
votes
1answer
55 views

using find and delete files/folder - with the exception of 1 folder - challenging

i want to use find and delete everything with the exception of one folder if found. e.g. [oracle@SJOAM test]$ ls -l total 4 -rw-r--r--. 1 oracle oinstall 0 Sep 2 02:05 a -rw-r--r--. 1 oracle ...
1
vote
2answers
49 views

“read” works as expected in ZSH but behaves differently when using any other shell

I’ve written a short while-do cycle but I found it working strange with different shells. That's it: find "`pwd`" -type d | while read -r D; do ls ${D}; done When I start it using zsh, all goes ...
1
vote
1answer
130 views

Bash script to create a folder structure

I'm trying to write a Bash script to automate a recurring task, namely the creation of a structure of folders, where some of them should be numbered (To be more specific, this is meant to archive some ...
1
vote
1answer
62 views

Upstart: What is the first tracked PID w/o expect, but with script AND exec?

I have some Upstart configs used to start some foreground and blocking processes to run in the background as some kind of "daemons", especially those processes do not fork in any case. What I want is ...
0
votes
0answers
17 views

Running SGE array job

I am working on SGE and I want to submit an array job for 10 files. For the time being to keep it simple I want to use only 2 commands in the script for each input files So let's say I have 10 input ...
1
vote
0answers
98 views

How to set output of terminal to external VGA display

I have laptop with broken screen and external monitor that i can connect to laptop via VGA port. Is there any way how to set output of shell(I have no GUI on installed debian) to VGA monitor? I can ...
0
votes
0answers
34 views

How can I get new messages in thunderbird via linux terminal?

I am trying to find a way of getting new messages from Mozilla Thunderbird without opening it.
1
vote
3answers
65 views

How to scp-and-ssh with specifying host twice?

I frequently do this kind of thing: scp somefile me@host:/some/path ssh me@host Typing out me@host twice can be irksome. We (or at least bash) can grab that last argument with !:$, but that ...
-2
votes
1answer
51 views

bash: Loop over lines of a file

Here is my script: #! /bin/sh for line in $(cat list); do echo "[$line]: Getting my workers list.."; var=$line-"worker1"; echo "$var" >> "hostlistworkers.txt" ...
-1
votes
2answers
62 views

Enter shell script output in a Xml file

<property> <name>mapred.tasktracker.map.tasks.maximum</name> <value>2</value> <description>The maximum number of map tasks that will be run simultaneously ...
-1
votes
2answers
69 views

formatting output in bash shell to remove special characters - linux

I am issuing the command below against a logfile grep "Oracle Audit" /var/adm/messages | awk '{print $6}' How do I format the below output Audit[9460]: Audit[10507]: Audit[10507]: Audit[10507]: ...
2
votes
1answer
78 views

Incorrect output of history command of ssh. How to read the timestamp info correctly

I set the HISTTIMEFORMAT variable to store the timestamp info .bash_history file. I am able to display the history properly if I use interactive shell. But, when I run history command to display ...
0
votes
3answers
145 views

/etc/shadow and /etc/passwd privilege - why is it writable

sghk1> id uid=0(root) gid=0(root) sghk1> ls -l /etc/shadow -r-------- 1 root sys 4045 Aug 24 15:52 /etc/shadow sghk1> ls -l /usr/bin/passwd -r-sr-sr-x 1 root sys ...
1
vote
2answers
561 views

Change default shell on MSYS2

I want to change MSYS2's default shell from bash to zsh. I've tried chsh - not available in MSYS2. Editing /etc/passwd does nothing. It seems to be ignored. I took a look at the batch scripts in ...
0
votes
0answers
21 views

Undo command Linux “rm” [duplicate]

Please, I have used rm * in a script shell, it deleted all my files? (a typo) Is there a solution to recover these files ?
2
votes
2answers
93 views

Run tcsh with arbitrary startup script

I want to create a new instance of tcsh and source an arbitrary script, all in one step. The problem is that when I use the -c option, the shell instance closes as soon as the script is complete. ...
1
vote
1answer
112 views

How do I list all installed packages from the command line in bash / osX

What is the -bash command to list all the packages installed locally on my machine? I am using osX. I tried the following so far: dpkg -l - doesn't work. apt --installed list - doesn't work. ...
2
votes
1answer
26 views

How to run overdue at jobs

Sometimes I have at jobs overdue after system-suspend that don't run after waking up. How can I tell atd to run them? I tried atd -s or atrun but I guess that isn't meant for this as it doesn't run ...
0
votes
2answers
79 views

FFmpeg : mp4 and multiple srt into mkv

I have a couple of srt subtitle tracks for an mp4 video. How do I make them into mkv using ffmpeg/avconv? I would like to use space efficiently. Performing conversion on Darwin v13. I will be ...
0
votes
1answer
45 views

Why awk printing wrong string into the output file?

I'm trying to read file with awk and write the output in a new file. Content file sample: DATE_Login|09:01:20.507|2015-08-13|TIME_Session|00:32:32|MX|w32 ...