Reputation
319
Top tag
Next privilege 500 Rep.
Access review queues
Badges
1 9
Impact
~22k people reached

  • 0 posts edited
  • 0 helpful flags
  • 100 votes cast
Feb
15
comment Linux shell script: Allow user to provide variable names in input prompt
Yes, this works!
Feb
14
comment write error: No space left on device. Removing 'extra' packages. Attempting recovery
First you should check which disks are full an why they are full: check the larges files and the newest files on these file systems. Maybe there are log files that you can clear, core dumps that can be removed or files you copied to the system but don't nee anymore.
Feb
8
awarded  Autobiographer
Aug
1
comment du -hs shows 15gb usage but the files are 30gb on the local disk
when a30gb file needs only 15gb on disk then the os has done some compression.
Mar
24
comment How to add a line to a file which has only root write permission and to continue the script execution
I think you will run into troubles with you double quotes
Mar
24
comment How to add a line to a file which has only root write permission and to continue the script execution
@Ryne Everett: I am not familiar with sudo. But the behaviour of 'su' is actually as needed by the script of the OP. Most of the time I use 'su' the other way round: changing from root to another user. In this case no password is needed ast all.
Dec
1
comment Rename files with even numbers
If you do a mv 1-001.png 1-002.png than 1-002.png will be overwritten by 1-001.png. You should be aware of that. On way to overcome this is to start with the highest number.
Dec
1
comment How to use printf to show the results of a calculation?
There is no need for the unreadable printf '%s * %s\n' "$salary" "0.15" . One can use echo "0.15 * $salary". the "-quotes suppress the filename globbing but allows the evaluation of variables.
Dec
1
comment How to replace this value in bash/sed
Your answer contains 10 lines. 9 of them are of no interest to the reader. Maybe it is better to remove them and add some explanation that helps to understand the regular expression. Your prompt is not chosen very well for a code sample: the blank between the path and the trailing '>' makes me believe that the '>' is part of the command. Also the information moi@laptop:/home/moi/tmp is not really valuable.
Dec
1
comment Sed: how to replace nextline \n symbol in text files?
It is true that \nseparates a line from the nextline but it is commonly known as newline character
Nov
26
comment Change Text File Encoding without knowning the source encoding
Why do you need this?
Sep
24
comment How to remove all comments from a file?
you cannot remove parts of a line with grep. you can use sed for this
Aug
15
comment Identifier must be declared
you can try to shorten your program but in such a way that the error still will be raised. So you can narrow down the statement where the error occurs.
Aug
15
comment Identifier must be declared
what shell are you using?
Jun
17
awarded  Caucus
May
6
comment How to sed -e 's///' everything except a specific pattern?
does each line contain only one % sign?
May
6
comment Detecting extension files doesn't executed for a period
you suggest to use the option "newer" but actually you use "newerat"
Apr
30
revised Remove last comma from a bash for loop generated string
minor changes
Apr
30
answered Remove last comma from a bash for loop generated string
Apr
4
comment What does $# mean in shell?
you can browse the manual