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
3answers
181 views

Is it possible to TFTP files via shell script in OS X?

I'm working on migrating my development environment from Windows to OS X and have run across a problem with TFTP. I use TFTP to upload files to an embedded network device, this is the only option to ...
0
votes
1answer
34 views

Sed is not Interpreting Pipes Correctly

OK, this is hard to explain, so I will give a reproducible example: I have a text file test.txt contains the line: somesetting-parameter /an/old/path I want to replace it with a path I can get via ...
0
votes
1answer
99 views

Color in bash prompt messes up git output

I changed my .bashrc to include export PS1="\033[1;33m\u@\h: \w>\033[0m" so that my shell prompt would be colored, but it seems the \033 messes up git output (log and diff, at least). I see ...
0
votes
1answer
144 views

Choosing shell for xterm in Cygwin

Basically my question is closely related to this one: http://stackoverflow.com/questions/21905380/how-do-i-get-cygwin-xterm-to-use-bash-and-not-sh I also want to set bash as the default shell for ...
0
votes
0answers
10 views

Output of usbmon ( length field )?

In http://www.mjmwired.net/kernel/Documentation/usb/usbmon.txt#163 it is written that before status tag ,there is data length field ,in my output for usbmon http://pastebin.com/b6U7Je7h please ...
3
votes
1answer
403 views

How to use usbmon for knowing amount of data transferred from usb (pendrive )?

Please someone explain me in simple terms how to use usbmon to track the amount of data transferred from pendrive ?
-2
votes
2answers
69 views

Trying to count and print song file names using awk

RANK NAME BAND YEAR GENERE DOMESTIC/INTERNATIONAL 206:Reach Out, I'll Be There:The Four Tops:1978:Pop:3/2 207:Bye Bye Love:The Everly Brothers:1950:Classic:3/2 ...
2
votes
1answer
426 views

A List Of Windows Shell Commands [duplicate]

I would love a list of Shell commands for Windows. Not to be confused with commands that you would run in Windows DOS. Over time I have come across these commands here and there. Like for example if ...
0
votes
1answer
191 views

redirecting output in crontab

I have a shell script to monitor table stats and java apps. It works fine when I run manually. But if I put it in the crontab it will get stuck if I don't redirect it's output with export display ...
0
votes
2answers
31 views

CLI tool to graphically select lines during piped commands

Is there a tool similar to choose that I can plug into chain of commands that will let me select (multiple) lines for the next step? choose unfortunately doesn't "pass on" the line you select, ...
0
votes
1answer
36 views

alias can't find a file that actually exists

On my personnal computer, not a server, in my .bash_profile (I'm on OSX) — sym-linked to .bashrc, I have the following line among some others : alias deploy=sh ~/dir/ectory/deploy.sh The file ...
1
vote
2answers
310 views

How to stop shell script if curl failed

I have script that used curl when i pass wrong parameters to script curl failed but script continue executing. I have tried use curl -f/--fail parameter but problem does not solved. What is the best ...
1
vote
1answer
52 views

What is the ZSH equivalent of 'expr'?

The expr utility evaluates an expression and writes the result on standard output. What is the canonical ZSH way to evaluate an expression, and print the result? Solution: I believe the answer is ...
0
votes
0answers
82 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
1answer
122 views

Where does Internet Explorer store the last used upload directory?

I have an image of a user's hard drive from which I need to recover some photos, but I don't know the file names or directory they are stored in. The photos are not in any of the typical profile ...
1
vote
1answer
26 views

Background chained ssh tunnel dropped instantly

I'm trying to establish the following chained ssh tunnel: ssh -A -t gatewayuser@gatewayserver 'ssh -N -A -t -R 55520:127.0.0.1:55520 user@dbserver' & This is part of a shell script, I want the ...
0
votes
0answers
29 views

Why does CygWin shell uses TAB completion for .DLL files?

If I type in a CygWin Bash shell forma TAB, the result expands to format.com. But if I type modeTABTAB, the results expands to: $ mode mode.com modemui.dll As long as .DLL files are not ...
0
votes
1answer
111 views

Using find and wc -L to find files containing lines longer then 500 characters

I have this command: find . -name "*.php" -exec wc -L '{}' \; And I believe it gives me the count of the longest line for each file. But I'm looking for a way to only print out the count and file ...
0
votes
1answer
44 views

Kill display manager and start another one with a script

I have a small script in which I kill gdm3 and start up an X Session. It works, but I have to run it 3 times. export DISPLAY=:0 var = $(pidof gdm3) kill $(var) X :0 & xterm & export ...
0
votes
1answer
43 views

How to print process id into statment

I have assigned a work to take take all process and make them into a statement. So I tried this script. #!/bin/bash a= ps | awk '{print $1}' echo select $a So I am getting this output PID 1838 ...
1
vote
1answer
49 views

How do I identify shell script execution vs dot execution

I'm writing a bash script that needs to run on the current process for it to be useful. That is, I want to make sure that the script was invoked with source script.sh or . ./script.sh and not ...
1
vote
1answer
89 views

writing more complex math input to fish shell

The fish documentation explains that the math command is essentially a thin wrapper to bc. The bc documentation has further info about more complex ops: If bc is invoked with the -l option, a math ...
1
vote
0answers
49 views

Terminal's bin/bash not responding

I have Googled through several instances of this issue but cannot get Terminal to open up with bash. I restarted the program, the computer and even logged in through another Administrator account but ...
0
votes
3answers
377 views

How can I add a program path to the Windows environment variables for easy command line access?

Let's say I want to add the following path to the Windows environment variables: C:\Program Files (x86)\VideoLAN\VLC\vlc.exe Such that I can simply type the following from a command line without using ...
1
vote
3answers
126 views

Linux if elif else fails

I am trying to find if mount point 1 is available and if not mount it. If mount point 1 fails, mount 2nd one. If that fails then display a failure message. Here is the code: mount > /tmp/log; ...
2
votes
1answer
53 views

Are there limits to file length piped from find to xargs or using find -exec +

In question [ Find and delete all the directories named "test" in linux ] on this site, the best answer talks about using these two commands: find . -name test -type d -print0|xargs -0 rm ...
0
votes
1answer
43 views

find files older than create its parent folder in a directory and move them there

I've been trying to create a bash script that does the following. Use the find command to search for files older than 7 days (find . -type f -mtime +7 ! -iname '.*', take the parent directory(of the ...
0
votes
1answer
115 views

Shell script truncated when run from cron or at

I'm seeing some very strange behavior on a Linux based NAS (DNS-323) I have. I'm using a simple shell script to back up the files on the NAS to another box. After making some recent additions, the ...
3
votes
2answers
355 views

What's the ZSH equivalent of BASH's $PROMPT_COMMAND?

BASH supports a $PROMPT_COMMAND environment variable that defines a command to be executed before any first-level interactive prompt. I'm looking for a ZSH equilvalent of that. The documentation says ...
1
vote
1answer
133 views

Switch back to VIM before shell command finishes

When executing a shell command in VIM, it waits for the command to finish. You can press Enter to switch back to VIM, but it will only switch back after the command has finished. In the event of a ...
0
votes
0answers
11 views

How to Sent a Parameter to A Specific Jar From the Context Menu in Explorer?

I have a jar file at this path C:\mgnfcnt.jar . I added an option to right click to fire this jar when user clicked this option. And also I want to send the path of file whick right clicked to this ...
0
votes
1answer
165 views

How to rename a file with the current date from the context menu in Explorer?

I want to be able to rename any file or folder with the current date, so I added the following key value to the registry, to get this option to show up in the right-click context menu: ...
0
votes
1answer
298 views

How do you run a command as another user on Linux?

I have access to a linux server where I can sudo to 'foo' like this without a password: sudo su - foo Once I am the 'foo' user I am able to run a script like this: /dir/foo_user_script.sh The ...
1
vote
4answers
97 views

Skip parameter in Linux bash

I need to write a shell-script which handles 3 parameters ($1 $2 and $3). Within the bash I have to skip parameter 2 (I'm actually writing something like ./script.sh para1 para3). The script is OK. ...
1
vote
2answers
85 views

Can I use shell: commands to change directory in CMD?

I am trying to create a batch file which installs favorites on all company PCs and Notebooks. Is it possible to change the directory in CMD using shell:favorites? I need this because on the ...
0
votes
0answers
46 views

Vagrantfile - is rvm in ~/.rvm/scripts/rvm or ~/.rvm/bin/rvm?

I'm still learning my way around some of the more hidden files in terminal and I was trying to setup a Vagrant box with rails via shell script provisioning, with some help from these links: ...
0
votes
1answer
23 views

Should I put local/custom directories first or last on my path? [closed]

If I (a regular user) have, for example a ~/bin, with executables in it, should that go first or last on my PATH? why? Is there a standard/conventional approach under Linux? This question ...
0
votes
1answer
46 views

How to unzip the Portuguese file

I have a zip file containing data in Portuguese. When I try to unzip the file $ unzip abc.zip It creates a file "abc.csv" but when I try to look into data, I get "?" instead of characters like ...
3
votes
1answer
448 views

#!/bin/bash -e :: what is `-e`? other arguments?

I am a shell script coder that always opt to use shell as top level as part of my belt in creating website apps on the fly and have relied on my bash scripts if I want a project to be implemented ...
0
votes
1answer
358 views

BitLocker missing in Windows 8.1 Pro

This is a TPM-free laptop dual booting to Windows 8.1 Pro and Windows 7 Pro. BitLocker was turned on in Windows 8 Pro (before upgrading to 8.1) via group policy. Everything was fine initially, but ...
2
votes
1answer
754 views

Is there a way around broken pipe?

I have a directory with a large number of files. ./I_am_a_dir_with_many_subdirs/ Within a script I'd like to find all subdirs in it, to sort them and to output to a bash array. So, I do: ...
0
votes
0answers
16 views

(MAC) Change location of shell script's shell

When I make an executable shell script ("http://chimpy.wordpress.com/2010/08/29/mac-os-x-shortcut-link-to-python-script/", but without the python part), It's pointer location (The location commands ...
0
votes
2answers
268 views

curl shell command always returns error status 0 - even when fails on input errors

Example: trying to upload a non existing file - curl -d @no-real-file http://google.com | echo $? - returns 0. How can I make curl fail on input errors?
0
votes
0answers
36 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
24 views

tmux completion (not shell completion)

Is there any way to do completion of arbitrary text from your tmux session (e.g. output from previous commands)? Something similar to hippie-expand in emacs or Any word completion in vim? Note that ...
0
votes
1answer
71 views

input from shell in bash script

i have a bash script i would like modify to support input from shell atm i have to type the link after i have run the script wiak@test:~$ scripts/lget.sh gimme cookie! ...
2
votes
2answers
166 views

Linking multiple files

In bash, say I want to link some but not all files from a directory, e.g., ln -s /dir/file1 /dir/file2 ... /other/dir but the format of the names of the files do not follow some simple rule, so we ...
1
vote
1answer
554 views

Creating a zip file with a timestamp

I have been trying to create a script which compresses a directory with a timestamp and move it to another location on the same server, but I cant seem to get TESTDATE to display on the zip file, ...
2
votes
3answers
115 views

How can I find folders containg x files of a particular type and output those paths on OSX

I have this script for OSX for finding folders that only contain one file, and if that file is an audio file outputting the path of the audio file find "$1" -type d -exec sh -c '[[ $(find "$0" ...
0
votes
2answers
57 views

I want to find out word which ends with ()…Use grep

I want to find out word which ends with ()...Using the grep command in linux. grep file_name_where_i_want_to_search "*()" some thing like that....but its not working