21,525 reputation
34778
bio website
location United States
age
visits member for 3 years, 8 months
seen 12 hours ago

Debian user, GNU/Linux enthusiast, FLOSS supporter, hobby developer.


Dec
3
comment Repeatedly execute bash command while there's no output from another process
Update your question. What is this command that runs every 5 seconds supposed to accomplish?
Dec
3
comment Repeatedly execute bash command while there's no output from another process
What are you trying to accomplish?
Dec
3
comment Repeatedly execute bash command while there's no output from another process
Does fs_usage ever terminate? If not you need a different approach. What tail does is get you the last line(s). It can't know what the last line is until its input terminates, so as long as the pipe chain is held open tail will never output anything.
Dec
3
comment How to move a file and change its name without retyping the name and just add the new characters
You should specify what shell you are using.
Dec
3
comment How to grep for same string but multiple files at the same time?
grep can take more than one file argument.
Dec
3
comment Increasing ulimit stack size benefits?
As far as I know, stack size should not affect speed. If you don't have enough you crash with a stack overflow error. More stack usually should not affect performance.
Dec
2
comment Print last character in the given path
@Aravind Albert's answer assumed you were using bash. If you are using ksh there may be feature differences causing your error. See my answer for something that works in all shells.
Dec
1
comment Rename files with even numbers
@KasiyA I see, the leading zeroes were being interpreted as octal numbers. Stripping out the leading zeroes seemed like the easiest way to fix that issue.
Dec
1
comment Rename files with even numbers
@KasiyA I am not sure what you mean. What file name?
Nov
28
comment Identify whether terminal is open in guake
@DisplayName Guake is a graphical terminal emulator for GNOME.
Nov
27
comment find the max value of column 1 and print respective record from column 2 from file
This should work but is inefficient, because sorting is overkill when the task is to find a maximum.
Nov
22
comment How to capture command line input into logfile and execute it at the same time?
@jottr Another question. Would bash history work for you or do you want this selective logging in addition to normal bash history (i.e. logged commands should go to both .bash_history and the other log file).
Nov
21
comment Calling multiple bash scripts and running them in parallel, not in sequence
There is nothing that prevents you from typing all 3 of those commands in the same line. nohup ... & nohup ... & nohup ... &. If you mean instead that you want to run all of the scripts without typing each script name individually, a simple loop will do it.
Nov
21
comment Calling multiple bash scripts and running them in parallel, not in sequence
What does "single call" mean?
Nov
21
comment How do you make case statements with ranges
Conditional probably refers to if statements. The | in a case statement is not a conditional. It is a merely a pattern delimiter.
Nov
21
comment How to capture command line input into logfile and execute it at the same time?
@jottr Yes, functions can do just about everything an alias can. I'll post an answer.
Nov
21
comment How to capture command line input into logfile and execute it at the same time?
@jottr The least clunky method I can come up with at the moment is to make an alias like alias loglast='fc -ln -1 | cut -c 3- > ~/command.log', and then just run loglast after every command you want to log.
Nov
21
comment How to capture command line input into logfile and execute it at the same time?
You say "selectively". What is the selection criteria? Are you fine with manually typing a few extra characters for every command you want to log?
Nov
14
comment Strange bash sytax error depending on sudo usage
He's running it as ./scriptname and the shebang is clearly #!/bin/bash. I would be puzzled as to why sh would get invoked here.
Nov
14
comment How do I define alias with variables which can be changed at runtime?
It's not clear exactly what your example commands are supposed to do, but try taking a second look at functions. Functions are basically more powerful versions of aliases.