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

learn more… | top users | synonyms

3
votes
1answer
928 views

How can I run an AppleScript or shell command on Mac OS X at screen unlock?

Note that this is not the same as startup or login. I never log out of my machine and I want to run the script whenever I unlock the machine to start working.
2
votes
1answer
41 views

Special equal character with sed from shell

My environment: I am working with the command interpreter on Windows. I use an sh.exe that came with some proprietary tools I have installed. I do not know the details of that sh.exe but here is ...
2
votes
1answer
20 views

Various environments and weird less behaviour

I am playing with I/O redirection and have problem with less behaving differently in two environments. Both environments are Solaris-based and are of the same version. I am executing program in two ...
2
votes
1answer
79 views

Standard utility to write stdin to a file with no stdout?

I have two cases where I want to create a file with its contents supplied on standard input: I need to use sudo to have the privileges to create a file. An application always invokes an ...
2
votes
1answer
145 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 ...
2
votes
1answer
60 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.
2
votes
1answer
50 views

My host offers SFTP only, not SSH. Can I still use private key authentication? i.e., does SFTP use SSH implicitly?

I'm using WP Engine as my host. They are a managed host and they never offer shell access. However, they do allow setup of SFTP accounts. My (limited) understanding is that SFTP still uses an SSH ...
2
votes
1answer
29 views

Wrapping `time` (and similar keywords) in call from another script

I have a Bash script (let's call it clock) which should work as a wrapper similar to the time keyword in Bash, e.g. clock ls should do something and then run ls. Here is an example of this script: ...
2
votes
1answer
247 views

Command Not Found When Executed via PHP shell_exec()

I want to execute following command on my Ubuntu server using php: android create project --target 8 --name $fname --path ./$fname --activity MainActivity --package $fpack 2>&1 The above ...
2
votes
1answer
264 views

Is there a Unicode-aware LC_COLLATE sort order which respects punctuation?

As far as I can tell, setting the environment variable LC_COLLATE=en_US.utf8 changes four things compared to LC_COLLATE=c, regarding how programs like ls will sort files: Unicode characters are ...
2
votes
1answer
109 views

In bash 4.3.27 “su” ignores user variables when combining “-” with “-c command”?

Since forever we used to launch user scripts from a different user crontab like this: 00 12 * * 1 su - user2 -c "/home/user2/myscript.sh" By doing this, the script is launched after the interactive ...
2
votes
1answer
511 views

How to get a shell prompt in NX?

I have installed nxserver on a ubuntu machine and am able to connect to this machine via the free NX client on a windows machine. Things seem to be working fine except that the xterm has a weird NX ...
2
votes
1answer
299 views

Error “Insecure world writable dir /Volumes/BOOTCAMP in path, mode 040777”

I tried the answer sudo chmod go-w in my /Volumes/BOOTCAMP but I'm still getting the warning It says Insecure world writable dir /Volumes/BOOTCAMP in PATH, mode 040777 And when I echo $PATH ...
2
votes
1answer
568 views

Echo string in tcsh with special characters escaped

Is it possible to echo out a string in tcsh such that it is fully escaped, as tcsh would understand? In the same way as printf %q works in bash: % # Create a variable containing a tab character % ...
2
votes
1answer
86 views

Set timeout on zsh autocompletion

I like ZSH's autocompletion feature, but often it hangs my terminal. I'd like to set timeout on autocompletion so it cancels (kills) itself after n miliseconds.
2
votes
1answer
2k views

Cygwin runtime errors (“couldn't allocate cygwin heap”)

I am getting following exceptions when I start running some commands in Cygwin. C:\cygwin\bin\bash.exe (4136): *** couldn't allocate cygwin heap, Win32 error 0, base 0x740000, top 0x755000, ...
2
votes
1answer
1k views

Tab Auto-Completion in Mac OS X when using sftp in terminal

i have been getting very frustrated lately since the readline functionality has been removed from MacOSX and Tab Auto-Completion doesn't work anymore. So i was wondering if anyone knew a good ...
2
votes
1answer
352 views

windows “open command window here” gives wrong environment

I often use the right-click "open command window here" feature of Windows-7, but just found a problem where the environment it gives is different than what I get on running cmd from the start line, or ...
2
votes
1answer
801 views

Replace bash shell with python program's cmdline interface

I have a program which uses python's cmd module for command line interfaces. Now I want it to run on my Linux server whenever any normal user logs in to it, in a way that user never gets the default ...
1
vote
1answer
25 views

files dissapear when I run mv command

I use the below command to move files: mv *.gz directoryname but directory name has spell mistake and the file with directory name has been generated with unknown format. And I lost my file. How ...
1
vote
1answer
30 views

How to change shell to custom shell?

So, I have made a little shell script in PHP with some basics functions (ls, cat, etc..) and I'd like to use it as my default shell. But since I don't want to do a mistake, I have some questions: If ...
1
vote
1answer
14 views

Why doesn't cronjob execute feh command

I build a cronjob to download a new picture from a source every ten minutes and set it as wallpaper using feh. The file is downloaded but the wallpaper doesn't change. Where is the problem? crontab -e ...
1
vote
1answer
17 views

How to sudo using another user's account password from a script?

I have a bash script running as user, a user account with no evaluated privileges. The machine has a second account admin which has sudo privileges. There is no root password set. The script knows ...
0
votes
0answers
387 views

Unable to run tmux on OS X

So I got brew on my mac and I had tmux installed and running just fine. Then after I refreshed my system every time I try to run tmux i get this error: "-bash: tmux: command not found" So since I'm ...
0
votes
0answers
47 views

open a new screen in linux, no access to perl local library

I added my perl local library to my shell startup script (.bashrc) and when I start a terminal in linux: $ echo $PERL5LIB /home/perl5/lib/perl5:/usr/share/vcftools/perl BUT when I open a new ...
0
votes
0answers
259 views

Only single beep for a series of bells in PuTTY

After typing echo -ne '\a' && echo -ne '\a' in PuTTY session only single beep is being produced on local computer instead of two beeps. What is the reason? In PuTTY settings for this ...
0
votes
0answers
90 views

Ubuntu: `env -i bash --norc`, but include essential variables such as HOME, DISPLAY? (where are these set?)

Is there an easy way to isolate a session of bash so that only essential variables (HOME, USER, DISPLAY, etc.) are preserved? (essential in that many programs fail if HOME, DISPLAY, TERM, SHELL, etc. ...
0
votes
0answers
316 views

Cygwin can't execute Shell script

I am trying to execute a Shell script using Cygwin. When I type this in the Cygwin terminal: sh build-native.sh I get this: build-native.sh: line 2: ndk-build: command not found It's a script ...
0
votes
0answers
43 views

What is wrong with this configuration of sudoers file?

I have to execute a shell script as another user, but without be prompted for password. I've edited the etc/sudoers file with visudo, adding the following line. _www localhost=(otheruser) ...
0
votes
0answers
114 views

libssh vs alternative root users

Here is an excerpt of the /etc/passwd file on a remote machine. root:x:0:0:root:/root:/bin/bash valid:x:0:0::/home/valid:/bin/rbash As you can see, valid is an alternative name for root. I can ...
0
votes
0answers
285 views

crash shell: any way to check if a command executed Successfully

I am automating a test using crash package. is there some thing like $? in bash shell, which can be used to check if previous command is executed success fully or not. eg : when command crash> ...
0
votes
0answers
175 views

autologin to root user with .cshrc

How do we cause login cshell to automatically execute sudo su - when a user first ssh into the linux box from Windows putty ? We tried putting this line sudo su - in .cshrc file but it is never ...
0
votes
0answers
89 views

script on a remote machine that archive files fails

I have a simple script (Given below) on a machine that collect files from several folders into a single one and then archive it. The script works as expected on the remote machine. When I run it via ...
0
votes
0answers
26 views

Different behavior from ubuntu server and ubuntu client on windows

#!/bin/bash # Reading cat /home/radiare/Desktop/first.txt | while read LINE do echo $LINE if [ "$LINE" == "false" ]; then echo "Inside first loop" break fi done echo "second file read started" cat ...
0
votes
0answers
536 views

Automation script to SCP from UNIX to Window Server

I'm new to server/Unix trying to transfer file between AIX to Windows I'm trying to create SCP or SFTP script that will run on cron and transfer text file on /usr/apps/11.111.1.11.log file to window ...
0
votes
0answers
106 views

Running different programs via ssh

I got some problem when I tried to run different programs via SSH. The problem is, let's say I have 2 different java programs, then I would like to run them simultaneously on different JVM, in order ...
0
votes
0answers
385 views

terminal with custom command

I am using Linux Mint 13 (Mate). I have edited my mate-terminal profile using custom command as follows mate-terminal --full-screen By mistake i haven't set the default profile to load. So terminal ...
0
votes
0answers
202 views

Analogue of the “tail -f example.log” command in Windows?

Is there a similar command in Windows?
0
votes
0answers
252 views

Xubuntu 12.04: Slow Login

I'm running Xubuntu 12.04, and after I ran the update, my login started slowing down big time. I've dabbled a little bit with the programs in Settings -> Settings Manager -> Session and Startup, and ...
0
votes
0answers
42 views

Shell Hotkey to Add File Name to Command

I have forgotten the hotkey to add a filename when using commands such as "cd". For example: cd (hotkey). and each time you press the hotkey, you get the name of one of the files in the current dir ...
0
votes
0answers
77 views

Can someone put some restriction to copy few files from folder by root in linux

I have the backup script where i was making the tar backup of directory everyday. ON friday i note that my filesize was 30MB but beofrethat it was 200MB. I checked the main folder and it was around ...
0
votes
0answers
158 views

Boot directly into application when power is cut

I have an application that I replaced the windows shell with so that windows would boot directly into the app instead of loading the desktop. After doing some testing I found that windows doesn't boot ...
0
votes
0answers
262 views

Nano (pico) editor window resize

I am still not sure what I have done but I was testing some button combinations when I was in nano editor and all of a sudden the contents of the window started not to adjust themselves when I resized ...
0
votes
0answers
833 views

Shell script to copy a text file from windows machine to linux based device

A linux based navigation device is connected with my windows machine. I want to copy a text file to root of device using shell script from windows machine(through cygwin or putty). please help. ...
0
votes
0answers
739 views

How to recover a directory that was corrupted to a 32kb file?

I am trying to recover a 200 GB directory that was accidentally lost and "converted" to a 32kb file. It was on a FAT32, 500 GB external hard drive. Only this folder got corrupted, on a Windows ...
0
votes
0answers
841 views

How to make a Shell Script create a copy and terminate itself?

So far I used trap " call function" 2 fucntion { ./test.sh exit } but it never reaches the exit line and a whole bunch of process piles up any one got any idea? I tried & (bg) but i need to ...
0
votes
0answers
463 views

user crontabs don't work, only /etc/crontab

Hi when I use the command crontab -e to set up cron, the commands get triggered (according to syslog) but nothing happens. Also if I run sudo crontab -e. The only way to actually get cron working ...
-1
votes
0answers
14 views

how do you run a terminal application in the background?

I am currently trying sleep 45 osascript -e "set Volume 7" say -v Whisper "hello" in a text edit file but when i run it it pops up with a terminal window. How would i hide or disable this window? ...
-1
votes
0answers
15 views

What to do for error: base64: command not found?

(cat << ! From: $FROM To: $TO Subject: $SUBJECT Date: $(date +"%a, %b %e %Y %T %z") Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="$boundary" This email has attached the file ...
-2
votes
0answers
16 views

I think I broke gnome-terminal

After toying around with custom startup commands in GNOME terminal, I came up with the fabulous idea to make it start with su. I didn't realize the 'close after the command executes' option was ...