Simple Linux Shell. stop command
location: linuxexchange.com - date: February 14, 2013
I am trying to implement a simple shell in linux and one of the features it should have is to enable to user to press <ctrl+D> and make it stop whatever it is doing - Basicly exactly what <ctrl+C> does in Bash.
Now I was wondering on the easiest way to do this, and I was thinking of some kind of key listener which would make the current task stop. Now the only way I could think of doing this would be to have a separate thread which would force stop and return the main thread to the base state, where it can take new input.
A separate thread would be the only way to "constantly" listen for the correct keypress.
I was hoping for some thoughts on this and possibly a better way to go about it.
I am trying to make a simple shell which can execute external programs, print/change directory, print/set path, print command history, invoke commands from history and print/set/remove command aliases. The CTRL-D is meant to be the equivalent of the CTRL-C in Bash, which allow
Linux shell script command gzip
location: linuxexchange.com - date: January 1, 1970
I am having one shell script in Linux in which the output will be generated in .csv format.
At the end of the script i am making this .csv to .gz format to reduce the space on my machine.
The file which is generated comes in this format Output_04-07-2015.csv
The command which i have written to make it zip is:-gzip Output_*.csv
But i am facing an issue that if the file already exists, then it should make the new file with that reported time stamp.
Can anyone help me with it.?
converting a linux shell script command into php
location: linuxexchange.com - date: October 7, 2015
I'm facing a problem that probably has an easy solution, but as I'm not a php expert I can not find it. I usually do this whan I have to call a shell command from php:
cmd = "convert file.pdf image.jpg";
But now I have a command that works on the shell that I can not make it run from the php, so I think there is probably a way to enunciate the same command but in php language,
for i in $(seq --format=%3.f 0 $nf); do echo doing OCR on page $i; tesseract '$imgdir/$imgdir-$i.ppm' '$imgdir-$i' -l eng; done
my php try:
$imgdir = "1987_3";
$nf = count(new GlobIterator('filesup/'.$imgdir.'/*'));
$cmd = "for i in $(seq --format=%3.f 0 $nf); do echo doing OCR on page $i; tesseract '$imgdir/$imgdir-$i.ppm' '$imgdir-$i' -l eng; done"
What I get is:
PHP Notice: Undefined variable: i in count.php on line 7
suggestions are very welcomed... thanks
I have read the question from the one I'm marked as possible duplic
Unix vs. Linux shell command
location: linuxquestions.com - date: January 9, 2007
I have a shell script written in Unix using command:
set -A envvar1 $envvar2
typeset -l variable1
What is the equivalent command for set -A and typeset -l in Linux?
Looking for a linux shell command.
- date: May 31, 2011
I'm looking for a specific command,if it exist... i want to login from my server to another linux server,but the question is: can i doit in a one line command for ex:
usually you type: ssh "user"@10.1.1.1 and then the password,but i'm looking for a command in one line a fake ex: ssh [email protected]
-p "password" something like that.
I don't know if anyone of you understand what do i want to say ..my english is so..bad
Linux shell command for makefile.in to create a text file and write to it
location: linuxquestions.com - date: January 5, 2005
Iam writing a makefile.in for my prgram .My make file is complete and is building the program well but
now i have to write a shell command in the above make file so that the shell command can extract the current working directory and create a file in "tmp" directroy and write the current directory to the text file.
iam using C as my development langauage.
i have never used and shell command can somebody help me in that
linux red flag command shell
- date: July 29, 2009
I have a question regarding linux red flag command shell.
I need to install sap abap netweaver for linux - it should be done like his:
Concatenate the seven files by opening up the shell and typing in the command:
cat N4S_TestDrive_MaxDB.iso_Part_a* > N4S_TestDrive_MaxDB.iso
there is 7 files (plus txt installation guideline as above) N4S_TestDrive_MaxDB.iso_Part_aa, ab,ac,ad,ae,af,ag
When I put this in the shell the result is as following:
N4S_TestDrive_MaxDB.iso_Part_a* : No such file or directory
I am completely new to Linux so maybe it is a stupid question but can you give me an advice how to concatenate those files?
Want to invoke a linux shell command from Java
location: linuxexchange.com - date: May 2, 2014
I am trying to execute some Linux commands from Java code using redirection (>&) and pipes (|). How can Java invoke that command in csh or bash?
I tried to use this:
Process p = Runtime.getRuntime().exec("shell command");
But it's not compatible with redirections or pipes.
What linux shell command returns a part of a string?
location: linuxexchange.com - date: May 30, 2013
I want to find a linux command that can return a part of the string. In most programming languages, it's the substr() function. Does bash have any command that can be used for this purpose. I want to be able to do something like this...
substr "abcdefg" 2 3 - prints cde.
Subsequent similar question:
Extract substring in bash
LXer: Command Line Arguments in Linux Shell Scripting
location: linuxquestions.com - date: June 6, 2015
Published at LXer:
Command line arguments (also known as positional parameters) are the arguments specified at the command prompt with a command or script to be executed.
Page: 1 2 3 4 5 6 7 8 9 10