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

learn more… | top users | synonyms

1
vote
2answers
30 views

What's the fatest way to calculate in command line?

Is there a faster way to calculate in command line the following: echo "4 * 5" | bc
0
votes
0answers
9 views

Are there any commands I can issue on DD-WRT to force full duplex (no vlan tab present)

Need to force full-duplex on my dd-wrt router, the vlan tab is missing and the direct link to it doesn't work either.
2
votes
1answer
18 views

Delete empty directories Synology NAS Shell

I try to delete my empty directories on my Synology NAS (DS415+). I tried: find . -type d | xargs rmdir But the problem is that I have directroies with spaces in the names like "hello (2012)". ...
1
vote
2answers
28 views

how to gzip and scp at the same time

I have a file in which i wanted to zip up and at the same time transfer over to another host using scp. I tried to do the following command but failed. I do not mind zipping up and scp over later, ...
0
votes
2answers
12 views

Rename multiple folders using shell script without matching a pattern

How to rename multiple folder/files by user defined. Say for Ex. I have multiple folders like krish, moorthy, ravi, robert, etc.. I want to rename all these directories as script_1 , script_2, ...
0
votes
0answers
23 views

Modify right click context menu with copy filename or copy full file path

I'm wanting to modify the right click context menu for windows explorer. I need to select a number of files and right click on them and copy the file path. Ideally I would also like the option of ...
0
votes
1answer
19 views

How to use echo in shell command from Makefile?

I have a GNU makefile. It runs fine on Linux, Solaris and OS X. However, under Cygwin-32, Cygwin-64 and MinGW, it produces: /bin/sh: -c: line 0: syntax error near unexpected token `(' /bin/sh: -c: ...
0
votes
1answer
15 views

scp files between hosts using ssh local port forwarding

I have a problem about transferring files between hosts. Lab environment is like: My host <-> Host A <-> Host B I only have access to Host A and I want to transfer files to Host B. Host A has ...
2
votes
1answer
41 views

What's the difference between dd and cat for writing image files?

When writing image files to disk or to a USB stick, the instructions usually use dd, like this: dd if=myimage.img of=/dev/sdb How is this different from, say: cat myimage.img > /dev/sdb I ...
0
votes
1answer
27 views

bash error when starting shell from tmux

When I open a new shell in tmux I get an error message. This error message does not show up when I start a new shell in GNOME terminal. What might tmux be running at startup that I need to check? ...
0
votes
2answers
20 views

Command host with awk

Please, why "echo" instruction: iphost="$(ssh root@$machine -x "host $machine | awk '/has address/ { print $4 }'")" echo $iphost display: g-3.xx.yyy.zz has address 172.16.65.35 instead of: ...
0
votes
2answers
43 views

How can i get the hostname of the machine i work on?

Please, how can i get the hostname (fully qualified domain name) of the machine i work on ? Here is my script: #! /bin/sh hostname=$(host $ipaddr | awk '{print substr($NF,1,length($NF)-1)}') ...
10
votes
3answers
1k views

How to run a command in background with no output unless there's an error

How to suppress a command's output but show it if the command exit codes an error?
1
vote
0answers
9 views

RVM is not a function message when using fish shell

I'm trying to use rvm from within the fish shell rvm gemset use rails3 I'm getting the following error message from fish RVM is not a function, selecting rubies with 'rvm use ...' will not work. ...
0
votes
1answer
17 views

Script Shell Storing ip address in a table

Here is my file: test.txt 172.16.65.29 172.16.65.30 Please, how can i modify this script to store all ip address in test.txt in a table. for ip in ${iparr[@]} do echo $ip done Thank you so much ...
-3
votes
1answer
24 views

How to get started with shell scripting? [closed]

My job profile requires a certain level of shell scripting and I have no idea on how would i get started with it Please suggest me with the easy ways to getting started with shell scripting. Thank ...
0
votes
0answers
6 views

Axel usage with script on UBUNTU

I write a shell-script to download files via axel but always I get a 403 FORBIDDDEN error. At the same time I copied the axel command which generated by my script to terminal manually and it works ...
0
votes
2answers
43 views

How to tell what are my startup files for sh or bash?

From this question I understand that depending on the operating system sh and bash behave differently. Doing env and alias I can tell that: Every time I open a OSX Terminal or run bash the variable ...
1
vote
0answers
34 views

Shell Commands not working : REDHAT

I added some service to the startup script and then after reboot , i got this message- 24 package(s) needed for security, out of 52 available Run "sudo yum update" to apply all updates. -bash: id: ...
2
votes
1answer
45 views

Execute command after broken SSH connection

Is there a way to execute a command after an SSH connection is broken (blackout etc.)? When I normally log off I can just use .bash_logout but I don't know what to do when my connection breaks.
1
vote
1answer
25 views

xrandr | grep “ connected ” give me more than one line but IFS=$'\n' read can't break it

I have something like this: declare -a DISPLAYS AUXILIAR="$(xrandr | grep " connected ")" IFS=$'\n' read -ra DISPLAYS <<< "$AUXILIAR" Why it isn't detecting line breaks if echo ...
1
vote
1answer
15 views

bash: history -a not writing unless HISTFILE already has text

Problem statement I've been following numerous examples for doing creative things with bash history along the lines of: # simplified example PROMPT_COMMAND='history -a; history -c; history -r' ... ...
0
votes
0answers
7 views

Let ctrl-c end entire fish function instead of one command in the function?

When executing a multi-line fish function, is there a way to let ctrl-c terminate the entire fish function instead of terminating just the currently running command in the function and letting the ...
3
votes
1answer
44 views

How to sort the output of find? [duplicate]

I'm using the find command to list files with their name containing a string: find ~/ -type f -name "*inductive*" I would like to use a pipe to sort the resulting list of files. I would like to be ...
1
vote
3answers
32 views

Extract a word from a string in shell script

I have a string as $sea = xyz-ajay-no-siddhart-ubidone-fdh-DMJK.UK.1.0-32133-Z-1.tgz and i want to extract only DMJK.UK.1.0-32133-Z-1 and search string will be DMJK I tried like echo $sea ...
0
votes
1answer
21 views

Double SSH and execute interactive shell

I need a bash script to ssh into server a then server b then execute an interactive shell. This is what I have: ssh -t -t server-a.com exec "ssh -t -t server-b.com <<<EOF cd ...
0
votes
1answer
30 views

How to upload all the files from local to host using Curl?

i have written a shell script to upload all files with different names in the specific path from local to host, but i have facing some issue and the files are not getting uploaded #!/bin/sh for file ...
0
votes
0answers
26 views

Running 'su - user sh -c “~/.profile”' returns “No such file” error

I have a shell script running as root with the following command: ssh remotehost 'su - user sh -c "source /home/user/.profile; <command>"' I get the following output: bash: su - user sh -c ...
2
votes
2answers
49 views

How to change the default shell in Cygwin?

I am trying to change my default shell from bash to zsh in cygwin. The normal unix command chsh isn't available on cygwin The etc/passwd file it seems isn't used anymore in existing versions of ...
0
votes
0answers
6 views

How to stop control/focus leaving the terminal when I start a GUI application

I have a Ruby script that launches Image viewer (eog) based on certain keyevents from the user. However Focus leaves the terminal(cursor stops blinking) when the first input is given. Until I click ...
0
votes
0answers
10 views

Why is OfflineIMAP working in reverse on my inbox?

Noticing some weird log messages coming out of offlineimap when I make my periodic sync, after I spent all night syncing all my messages down from Gmail. Here's an example of one of them: Folder ...
0
votes
1answer
32 views

Fixed space/width printing of variables in shell

I have made a tabular report of some data variables printed via printf in shell. Project One | 76 | 80M | 80M | 80M Project Two | 46M | 52M | 52M | 52M Project Three | 174 | ...
0
votes
1answer
11 views

Call MATLAB installed on network drive from Cygwin shell script

MATLAB is installed on a network drive, and I want to call it from a shell script. The installed location is \\apps\matlab2014b$\bin\win64\MATLAB.exe in P:\. I am using Cygwin to run the shell ...
-1
votes
0answers
50 views

How to populate environment variables in Mac OS X for CLI _AND_ GUI applications

I mostly use Linux as my development box, but I also run a Mac OS X based setup, which I would like to behave mostly as my Linux one. The main problem I face is to sync my environment variables I ...
0
votes
1answer
42 views

Multiple Conditions in shell script

Im stuck in giving two conditions in my script. I can read two things - What is the NEAREST SERVER If it is MacBook or Anything Else and then use defaults write command to modify the plist file. ...
2
votes
2answers
32 views

bash script.sh vs ./script.sh vs #shebang

Assuming i am in a bash shell now and i execute the following [me@server]$ bash script.sh q1) Is a new child bash process created to execute the script ? If i do a [me@server]$ ./script.sh q2) ...
2
votes
2answers
30 views

Running bash scripts from bash script in other folder

I've got several folders (one for each month), each with a bash script savetodatabase.sh. I want to run all of them after each other, so I made a script named saveall.sh which has the following code: ...
0
votes
1answer
20 views

String replacement shell script on AIX

I am using AIX, and there is not an -i option available in the version of sed I am using: sed: illegal option -- i Usage: sed [-n] Script [File ...] sed [-n] [-e Script] ... [-f Script_file] ...
0
votes
3answers
69 views

What is the config file for the sh shell on OS X? (i.e., ~/.bash_profile for bash shell, etc)

R uses the /bin/sh shell environment and I'm running scripts (that cannot be modified) that call gfortran-4.8 instead of gfortran so I'm creating an alias. I have added the following line to my ...
0
votes
1answer
35 views

How to open git for windows shell inside a tab on ConsoleZ

I have used git bash 1.9.5 from https://git-scm.com/download/win on ConsoleZ as shell and have no problem on open him inside a tab. But, with the new Git for windows 2.4.5.1 RC4, it open always in a ...
0
votes
0answers
22 views

Change bash to default login shell on AC66U running Merlin and Entware

I'm trying to switch from sh to bash as my default login shell, on an AC66U running the Merlin firmware. I have bash installed in entware's partition, but when I switch user:x:0:0:user:/root:/bin/sh ...
0
votes
1answer
60 views

Emulate a Linux terminal and shell commands in Windows [closed]

Ok, I am accustomed to Linux/Unix like terminal and its commands and now I am using Windows. Does anyone know how to emulate a Linux terminal and the bash Commands?
1
vote
1answer
35 views

Redirections shell

Can anyone explain the following? :~$ ls macreave.sh fgvdvg > testo 2> testo :~$ cat testo macreave.sh ccess fgvdvg: No such file or directory :~$ ls macreave.sh fgvdvg > testo ...
0
votes
0answers
12 views

Customize predefined entries in Windows Start Menu

I would like to add some custom entries to Windows XP / Vista / 7 Start Menu and place it between predefined options like: "Help and Support" and "Run" so that user cannot delete or move those ...
0
votes
1answer
26 views

/bin/bash -c stopping counting with date

/bin/bash -c not starting counting with date: /bin/bash -c "while true; do echo [`date +'%F%t%T%t%Z'`] Keep Alive; sleep 1; done" The output is: [2015-07-06 13:44:36 UTC] Keep Alive [2015-07-06 ...
0
votes
5answers
42 views

Extract filename from file using shell script

I have a text file which has the following line: /u/tux/abc/spool/frtbla_mcdetc_0000149099_20101126135009990_1.tif I want to extract frtbla_mcdetc_0000149099_20101126135009990_1.tif; the word after ...
1
vote
1answer
23 views

Custom command not working

In my Ubuntu I tried to create a custom command: I added a bash script named ns3 in /usr/bin #!/bin/bash cd ns3/ns3-allinone-3.19/ns-3.19 I made it executable chmod +x ns3 Still it doesn't ...
0
votes
0answers
8 views

linux translate-shell -play command not working

I am new to linux and just installed translate-shell on Ubunutu 14.04 distr. If I run a translation, for example 'trans -p hello', I get the following error: [Warning] No avaible audio player or ...
0
votes
2answers
43 views

Shell script to pass multiple arguments with options in command line

I have the script, I need to execute this script like this: ./create_endpoint.sh --controller-ip 10.20.20.1 --controller-name User1. But its executing like this: ./create_endpoint.sh 10.20.20.1 ...
-3
votes
0answers
40 views

How to get total records affected in database: A shell script

I have written a shell script to update the records on database server. The query.sql file contains variable number(almost 600 to 800)of insert queries. As I am running the script, it runs fine and ...