Search Results

Search: Posts Made By: Arnaudh78
791
Posted By RudiC
Would mkdir $(date -d"$(ls -d...
Would
mkdir $(date -d"$(ls -d [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] | tail -1)+1day" +"%Y-%m-%d") - given your current working directory is the target directory - come close to what you need?
466
Posted By Corona688
The timestamps aren't 2 or more days apart yet,...
The timestamps aren't 2 or more days apart yet, only 1.6 days. One counts from midnight while the other counts from present time.

Your proposition works by forcing both times to start from...
682
Posted By rbatte1
Would iWatch (http://iwatch.sourceforge.net/) be...
Would iWatch (http://iwatch.sourceforge.net/) be a possible help here? I think you can defined directories to watch and can take action when a file is updated.

The question is also 'What removes...
595
Posted By durden_tyler
Please mention the Python version you're using. ...
Please mention the Python version you're using.
Since the difference between your two programs is the "input()" function, it should be clear that the "input()" function is the problem.

From your...
675
Posted By Aia
grep -o -E or grep -oE
grep -o -E or grep -oE
590
Posted By Corona688
I think that color_in_red=("${red}"$2"${none}")...
I think that color_in_red=("${red}"$2"${none}") this is incorrect, putting it in ( ) like that will make it an array. You should just do color_in_red="${red}$2${none}"

Also, if you're using BASH,...
923
Posted By Scrutinizer
@bakunin: not in this case, in some cat versions...
@bakunin: not in this case, in some cat versions the -n option prints line numbers.
923
Posted By MadeInGermany
The / separator in sed clashes with the /...
The / separator in sed clashes with the / characters in the variable.
Use another separator! Also put "quotes" around each $variable.
sed ''"$INPUT_LINE"'s#$# - OPTIONS:...
923
Posted By RudiC
Your problem is that the regex separators / ...
Your problem is that the regex separators / occur in the replacement text as well - char 29 is the "v" from /var/www...
Try different regex separators (e.g. # )
sed ''$INPUT_LINE's#$# -...
871
Posted By RudiC
Or, if you don't need the hostname further down...
Or, if you don't need the hostname further down the script and just want to collect the info in a file, try (untested):
for IP in $(egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' $CONFIG_FILE)
do echo...
871
Posted By stomp
Maybe this... TEMP_HOSTNAME=$(ssh "$IP"...
Maybe this...

TEMP_HOSTNAME=$(ssh "$IP" 'hostname')For temp_file2 you may store the information into an associative array(bash version >= 4.0) like this:


# declaration (important! automatic...
569
Posted By Scrutinizer
One way: read -p "Do you really want append...
One way:
read -p "Do you really want append this line in $CONFIG_FILE
$IP CLIENT: $IP_INPUT - PATH: $PATH_INPUT
y/n ?:" CONFIRM_INPUT

Another way:
read -p "Do you really want append this...
1,079
Posted By RudiC
You have DOS <carriage return> line terminators...
You have DOS <carriage return> line terminators (\r, 0x0D, ^M) in your config file. Use tr -d $'\r' <file to remove them upfront, or do it in the awk when assigning TARGET.


It's difficult to...
1,079
Posted By RudiC
Looking at the script in post#1 I feel inclined...
Looking at the script in post#1 I feel inclined to comment on a few points:

- Don't cd to and fro ( as already pointed out by greet_sed) but use absolut paths.
- Don't use temp files if not...
1,079
Posted By RavinderSingh13
Hello Arnaush78, Could you please go through...
Hello Arnaush78,

Could you please go through the following and let me know if this helps you.

TARGET=$(awk -F "PATH: " -vx=$IP ' $0 ~ x {print $2}' config_ip.cfg)
awk -F "PATH: " #### -F in...
1,079
Posted By greet_sed
Hi, You do cd twice so your directory is not...
Hi,

You do cd twice so your directory is not same as when your first line of
for IP in `egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' config_ip.cfg`Hence this grep says no such file or directory :
...
8,575
Posted By bakunin
You will find, that ssh, when executed as a...
You will find, that ssh, when executed as a securified rexec-replacement, returns the error code of the remotely executed program.

You could, therefore, equally try the likes of:

if ! ssh...
8,575
Posted By MadeInGermany
The && and || are evaluated locally. Enclose...
The && and || are evaluated locally.
Enclose them in quotes
ssh -qnx $HOST "test -d $FILE_PATH && echo 'Directory exists' || echo 'Directory does not exist'"
I have chosen the "quotes" because...
1,344
Posted By ctsgnb
see also man ascii man locale man tr# echo...
see also
man ascii
man locale
man tr# echo "0123456789aeiuAEIU" | tr -d [:alnum:]

# echo "0123456789aeiuAEIU" | tr -cd [:alnum:][:space:]
0123456789aeiuAEIU
Also...
1,344
Posted By disedorgue
In your case, you must set LC_ALL=C because you...
In your case, you must set LC_ALL=C because you want exclude characters with accent.

Regards.
1,344
Posted By disedorgue
Hi, Your regex in first post could work with...
Hi,
Your regex in first post could work with correct locale, example:
$ XX=""
$ LC_ALL=C
$ [[ "$XX" =~ [A-Za-z0-9_] ]] && echo ok
$ LC_ALL=fr_FR.UTF-8
$ [[ "$XX" =~ [A-Za-z0-9_] ]] && echo ok...
1,293
Posted By RudiC
A few comments: - the files' path seems to be...
A few comments:
- the files' path seems to be used inconsistently - either use absolute paths on file names, or cd into the working directory at the start.
- where do you store and/or use fetchip's...
1,293
Posted By MadeInGermany
You can have more than one line in a while/until...
You can have more than one line in a while/until condition.
The following uses a code block between until...do plus another explicit code block within {...}
#!/bin/bash
fetchip() {
printf "%s:...
1,066
Posted By MadeInGermany
i (insert) does not work on the last line. a...
i (insert) does not work on the last line.
a (append) works even on the last line. It must be a multi-line in order to work with all sed versions.
sed '12a\
address 192.168.1.96/'...
1,293
Posted By Chubler_XL
You could write a function to prompt for and set...
You could write a function to prompt for and set your IP address like this:

#!/bin/bash
fetchip() {

printf "%s: " "$1"
read
while ! [[ "$REPLY" =~...
Showing results 1 to 25 of 40

 

Featured Tech Videos

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