Search Results

Search: Posts Made By: ciupinet
3,736
Posted By ciupinet
sed -i 's/[ |\t]\+/,/g' input-file ...
sed -i 's/[ |\t]\+/,/g' input-file

---------- Post updated at 06:32 AM ---------- Previous update was at 06:28 AM ----------

But I see from your example that you want single spaces to not be...
2,744
Posted By ciupinet
Use the following: first check for the existence...
Use the following: first check for the existence of the key in the known_hosts file and if it is there then run ssh with publickey as the only authentication option:
if grep "$host"...
Forum: Cybersecurity 06-03-2011
29,583
Posted By ciupinet
Use this, assuming you don't have any other...
Use this, assuming you don't have any other iptables configuration:
iptables -A FORWARD -i eth1 -o eth0 -m mac --mac-source aa:aa:aa:aa:aa:aa -j ACCEPTFor the list of MAC addresses, assuming these...
Forum: Programming 06-03-2011
2,407
Posted By ciupinet
This line will generate the output you want: ...
This line will generate the output you want:
awk -F "'" '{for (i=2;i<=NF;i+=2) {printf $i" "}; print ""}' file_with_text
2,565
Posted By ciupinet
Check whether the UserDir directive points to the...
Check whether the UserDir directive points to the correct path or not and whether the user is allowed to have an UserDir directory or not.
Forum: Red Hat 06-03-2011
3,029
Posted By ciupinet
You shouldn't use "-i" as parameter to sudo,...
You shouldn't use "-i" as parameter to sudo, because this flag instructs sudo to run the command as a login shell like this:
/bin/bash -c /bin/kill 1234instead of
/bin/kill 1234 and you only gave...
2,405
Posted By ciupinet
It seems that in Mac OS, when sed is used with...
It seems that in Mac OS, when sed is used with -i, the backup extension is required, not optional, so we'll use an empty string for that in order to ingore backups. Change the sed line to:
sed -i ''...
2,405
Posted By ciupinet
I don't have a Mac OS sed to test it with, but...
I don't have a Mac OS sed to test it with, but you could try it by changing the sed line to:
sed -i "s/^/${i} ${j} /g" height_${i}_width_${j}.txt
2,405
Posted By ciupinet
Instead of `seq ` $max_i` you could use {1..3}...
Instead of `seq ` $max_i` you could use {1..3} (if you are using the bash shell). The only downside is that you have to use the actual value as the max value and not a variable.

Alternatively, you...
Forum: Solaris 06-02-2011
33,519
Posted By ciupinet
It's odd that /proc takes any disk space at all. ...
It's odd that /proc takes any disk space at all.

Anyway, your best choice would be to check the /var/log directory and archive and move old log files from there and also check the /root directory...
7,719
Posted By ciupinet
Use this command: sort -n -k 1 -k 2...
Use this command:
sort -n -k 1 -k 2 space_delimited_text_file
Forum: Red Hat 06-02-2011
1,985
Posted By ciupinet
You can use this command: ps --no-headers -eo...
You can use this command:
ps --no-headers -eo "%p %C %U %c %a" | sort -r -n -k 2 | awk '{if ($2 > 5.0) {print $0}}' > output-fileThis command outputs the PID, CPU usage, user owning the process,...
2,405
Posted By ciupinet
This bash script will do it for you: ...
This bash script will do it for you:

#!/bin/bash

max_i=4
max_j=4

for i in `seq 1 $max_i`; do
for j in `seq 1 $max_j`; do
if [ -f height_${i}_width_${j}.txt ]; then...
2,128
Posted By ciupinet
If you have your log files names following a...
If you have your log files names following a pattern (for example they all are ending in .log), then you can use this command:


tar zcf DB_Folder.tar.gz DB_Folder/ --exclude=*.log
If you cannot...
3,259
Posted By ciupinet
This one will do the job as well (assuming all...
This one will do the job as well (assuming all the lines start with "Sample "):


sed "s|^Sample \(.*\)|Sample $(date +%m/%d/%Y) \1|g" a.txt > b.txt
4,675
Posted By ciupinet
Doesn't work with values greater than 10 though....
Doesn't work with values greater than 10 though. If only sed supported if statements ...
9,018
Posted By ciupinet
I think that by running the script some of your...
I think that by running the script some of your files got replaced. For example, chp01_00001.wav is renamed to chp_bloomy_00001.wav, and chp02_00001.wav is renamed to chp_bloomy_00001.wav too.
4,675
Posted By ciupinet
However if the values are not unique and not...
However if the values are not unique and not sorted, you can use the following:


echo "ABC 1
ABC 2
ABC 3
ABC 4
ABC 5" | awk '{if ($2 <= 3) {print "#"$0} else {print $0}}'


Works as well...
Showing results 1 to 18 of 18

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