Search Results

Search: Posts Made By: bashily
1,002
Posted By balajesuri
Try system...
Try system (http://perldoc.perl.org/functions/system.html). Not sure how it would matter, but still give it a try.
1,514
Posted By agama
Ok, misunderstood. Put your 'work' into a...
Ok, misunderstood.

Put your 'work' into a function, and then as you said, use tee. This is from the code I cut/pasted a few posts ago, so it might not be what you are working with, but it shows...
3,098
Posted By agama
Implementing the suggestions I made before, this...
Implementing the suggestions I made before, this works fine for me:


#!/bin/bash

resetTime=1
mytotalTime=0
totalHour=0
totalMin=0
averagemem=0
finalaverage=0
times=0
function usage
{
...
2,198
Posted By jim mcnamara
This is from tldp.org - based on your question...
This is from tldp.org - based on your question history I would strongly advise you to read:

Advanced Bash-Scripting Guide (http://tldp.org/LDP/abs/html/)

You can download a pdf from there. It...
1,788
Posted By Scrutinizer
Hi, glad that you found useful. You could use the...
Hi, glad that you found useful. You could use the while-read loop after you find out about the file:

while IFS="," read field1 field2 field3 field4 ...
do
....
done < "$fileName"


After...
160,005
Posted By complex.invoke
Tetris Game -- The Art Of Shell Programming
GitHub - deepgrace/tetris: Tetris implementation in all kinds of Programming Languages (https://github.com/deepgrace/tetris)

Usage: bash Tetris_Game [ <runlevel> [ <previewlevel> [ <speedlevel> [...
8,937
Posted By Scrutinizer
First use getopts to get the options, then shift...
First use getopts to get the options, then shift the parameters to its proper position, through
shift $(($OPTIND - 1))

If you use
if [ -f "$1" ] ; then
then the filename may also contain spaces...
7,539
Posted By jim mcnamara
ctrue=N utrue=N while getopts ":c:u:fp" opt;...
ctrue=N
utrue=N
while getopts ":c:u:fp" opt; do
case $opt in
c) ctrue=Y && echo "-c was triggered, Parameter: $OPTARG" >&2;;
u) utrue=Y && echo "-u was triggered, Parameter:...
28,030
Posted By agama
You don't need the dollar sign. s*[0-9] ...
You don't need the dollar sign.


s*[0-9]


To test what might work, use the ls command:


ls s*[0-9]


It will list the files that match, and thus the files that would be put on the move...
3,443
Posted By drl
Hi. If you think that this section is taking...
Hi.

If you think that this section is taking too long to get an answer, you may want to consider posting in another section:

Here is a script that should get you started:
#!/usr/bin/env bash
...
28,030
Posted By 47shailesh
try this flist=`find ~ -name s\* -type f | tr...
try this
flist=`find ~ -name s\* -type f | tr "\n" " "`;
mv $flist $destination
1,450
Posted By jim mcnamara
Correct syntax: $((r=$RANDOM%$n+1)) ...
Correct syntax:

$((r=$RANDOM%$n+1))

That generates a random number between 1 and the value of n. % is the modulo arithmetic operator - the remainder of division.
1,755
Posted By agama
^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]...
^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])((\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$


There are 4 major sections. The red '^' at the beginning 'anchors' the pattern to...
16,561
Posted By agama
Really? Using last under linux, and the script...
Really? Using last under linux, and the script below, I can generate exactly what you described in your original post. If you're running on FreeBSD, then the fields are organised differently, and...
Showing results 1 to 14 of 14

 
All times are GMT -4. The time now is 05:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy