10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Need to count consecutive characters in a string and give the output as below
i/p=aaaabbcaa
o/p=a4b2c1a2 (10 Replies)
Discussion started by: prasanna2166
10 Replies
2. Shell Programming and Scripting
Hello All,
I am trying to purge X old days of files from directory & Sub directories
./2016-01-13/1500/abc.txt
./2016-01-14/1605/caf.txt
./2016-01-14/1605/caf2.txt
./2016-01-14/1606/eaf.txt
.....
./2017-08-1/1701/
Should also remove directories and sub directories too
Expected... (7 Replies)
Discussion started by: krux_rap
7 Replies
3. UNIX for Beginners Questions & Answers
I have the following file:
A1 4.5807 6.4202
B1 2.5704 11.4414
C1 5.5607 5.28872
D1 3.5807 8.2132
E1 3.2206 9.13153
F1 3.0907 9.51532
G1 3.2707 8.99165
H1 2.4607 11.9515
A2 2.5505 11.5307
B2 2.3106 12.7279
C2 3.8507 7.63731
D2 2.6208 11.2214
E2 2.7609 10.652
F2 2.0604 14.2734
G2... (2 Replies)
Discussion started by: Xterra
2 Replies
4. Shell Programming and Scripting
Hello all,
do you know any way i can i move folders and its content if folder is older than 1,5 days in bash?
I tried:
find /home/xyz/DATA/* -type d -ctime +1.5 -exec mv "{}" /home/xyz/move_data_here/ \;All i got was that Files from DATA /home/xyz/DATA/* ended messed up in... (1 Reply)
Discussion started by: ZerO13
1 Replies
5. Shell Programming and Scripting
I wrote the day calculator also in bash. I would like to now, that is it good so?
#!/bin/bash
datum1=`date -d "1991/1/1" "+%s"`
datum2=`date "+%s"`
diff=$(($datum2-$datum1))
days=$(($diff/(60*60*24)))
echo $days
Thanks in advance for your help! (3 Replies)
Discussion started by: kovacsakos
3 Replies
6. UNIX for Dummies Questions & Answers
Hi i know how to get no of files in some particular folder by following command which includes today and previous days files also
ls |wc -l
but i needed a command in which i can list previous one or two days files only. (4 Replies)
Discussion started by: rahiljavaid
4 Replies
7. Shell Programming and Scripting
ok basically im trying to count how many people fail a class by comparing there grade by -gt 49
i tried putting a count inside the while loop but i know you cant access a count outside a subshell. is there an easy way to count the number of failures?
declare -i failcount=0
awk... (2 Replies)
Discussion started by: nilekyle
2 Replies
8. Shell Programming and Scripting
Hi ALL
I have small script that find 777 dir now i want to count these directories,Keep in mind there are many directories.
This IS my code below.
#!/bin/bash
check=/var/www/html
find $check -type d -perm 777 | while read DIR
do
... (2 Replies)
Discussion started by: aliahsan81
2 Replies
9. Shell Programming and Scripting
Hi All,
I have a data as follow:
0
0
0
X
X
0
X
X
X
0
X
0
0
X
0
0 (16 Replies)
Discussion started by: nica
16 Replies
10. UNIX for Dummies Questions & Answers
Hello,
Im using cygwin app which we use the bash shell for scripting.
Im trying to read a filename with consecutive spaces on the filename
ex: filename<space><space>1.txt
ls -lrt filename<space><space>1.txt is working but when I pull that from a file and place it into variable. it reads... (1 Reply)
Discussion started by: james_falco
1 Replies