The shell is unix's command-line interface. You can type commands in a shell interactively, or write scripts to automate tasks.
0
votes
1answer
31 views
Multiple option arguments using getopts (bash)
Stuck here and need some help. Thank you in advance. ~Chris
I am trying to process command line arguments using getopts in bash. One of the requirements is for the processing of an arbitrary number ...
0
votes
1answer
18 views
Direct recursive shell script output to each subdirectory, not parent directory
I'm processing a batch of subjects data recursively, calling the script within the parent directory.
For example, I have the parent directory:
/home/subjects
and the subdirectories which contain ...
1
vote
2answers
35 views
“or” in shell glob
I want to ls the files containing the substring "s1r", "s2r", "s3r" or "s19r" in their filenames.
I'm almost there!
Botched attempts:
ls *s[123][9?]r*
The above gives me only files including the ...
2
votes
1answer
26 views
Invoking a script with ld-linux.so?
I just downloaded a tar file that is supposed to include everything required to run a program that we can call some_binary. I extracted it's contents, and I see the following:
A binary (let's call ...
3
votes
2answers
39 views
How to print several files at the same time using lpr?
I am trying to print a number of files from shell using lpr. I enter something like:
lpr -P PRINTERNAME ./*/dir/file.pdf
but I get "lpr: No file in print request.".
When I use ls as
ls ...
3
votes
3answers
55 views
CD into directory from HISTORY in a bash script or alias e.g. $(!!)
I often want to change into the directory of a file on my file system, but I'm not sure where the file is.
I search for it like so:
find -type f -name "myfile.txt"
Lets say for the sake of ...
1
vote
4answers
59 views
Problem understanding 'hash' command in a .sh file
So I wanted to install etherpad lite on a linux machine.
If I try to run it, I will get the Error "Please install node.js ( http://nodejs.org )"
the command 'which node' gives me the correct path to ...
2
votes
3answers
62 views
What process is running before I even get a prompt?
When I log in to a specific server I see the following:
Note that I get get Last login: ... information but no prompt. I hit Ctrl+C and only then do I get my prompt, thus proving that my username ...
1
vote
2answers
21 views
Calling bash from sh (dash) with commands read from args, and “Unterminated quoted string”/“unexpected EOF”
Just thought I'd document this: I'm trying something very simple - set env variable in bash, and print it out:
$ bash -c "a=1; echo a$a;"
a
$ bash -c "a=1; echo a\$a;"
a1
Now I'd want this same ...
2
votes
1answer
22 views
Installing packages and tools on a local non-standard directory
TLDR: What environment variables should I update to guarantee that my system has access to everything a package provides when building it on a non-traditional path?
I usually don't have root access ...
4
votes
1answer
227 views
How many users does Linux support being logged in at the same time via SSH?
I know Linux supports multiple users being logged in at the same time.
But what's the maximum number of users that can be logged into Linux at the same time?
I see there are there are 69 tty files ...
5
votes
2answers
142 views
Special character '#' in Perl SSH command
I try to send command using SSH in my perl script with # but it gets truncated right at #
Example:
Input text is :
$message = "Product ID # STK000134"
The SSH command is :
$execute=`ssh -q ...
3
votes
4answers
46 views
Getting stdin from a named pipe
What I am trying to do is run python in a terminal window and redirect it's stdin from a named pipe. Then I write to the named pipe in another terminal and have that command execute on python.
...
2
votes
1answer
61 views
Run remote shell daemon as non root user with tab-completion
I need to run any "remote shell daemon" (ssh, telnet, netcat, socat... I don't mind) as non-root user. The remote shell should provide tab-completion and I want to be able to browse history using ...
3
votes
3answers
76 views
Count number of lines of output from previous program
I'm trying to count the number of lines of output a certain program produces. The problem is, the program takes a long time to run, and I want to display the output to the user. Is there a way to ...