10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :).
set... (4 Replies)
Discussion started by: cmccabe
4 Replies
2. Shell Programming and Scripting
I need to use bash to remove duplicates without using sort first.
I can not use:
cat file | sort | uniq
But when I use only
cat file | uniq
some duplicates are not removed. (4 Replies)
Discussion started by: locoroco
4 Replies
3. Shell Programming and Scripting
Hello All,
I was wondering if someone might know how to do this. I have a word list that is format like the example below. I need to take away the :number after that... is there some kind of command I could use to remove them?
123456:5562
password:1507
123456789:989
qwerty:877... (7 Replies)
Discussion started by: 3therk1ll
7 Replies
4. Shell Programming and Scripting
I need to use a bash script to remove duplicate files from a download list, but I cannot use uniq because the urls are different.
I need to go from this:
http://***/fae78fe/file1.wmv
http://***/39du7si/file1.wmv
http://***/d8el2hd/file2.wmv
http://***/h893js3/file2.wmv
to this:
... (2 Replies)
Discussion started by: locoroco
2 Replies
5. Shell Programming and Scripting
Hi,
This should be a simple one: I run the following commands in bash and ksh respectively but got differenant results:
# ls -l /var/log > /tmp/a
# vi /tmp/a
In bash shell, I got:
^
In ksh, I got:
total 828552
-rw-r----- 1 root root 189 Aug 9 00:00 acpid
-rw-r----- 1 root... (7 Replies)
Discussion started by: aixlover
7 Replies
6. Shell Programming and Scripting
I would like to remove comments from a bash script. In addition, I would like to remove lines that consist of only white spaces, and to remove blank lines.
#!/bin/bash
perl -pe 's/ *#.*$//g' $1 | grep -v ^]*$ | perl -pe 's/ +/ /g' > $2
#
# $1 INFILE
# $2 OUTFILE
The above code... (10 Replies)
Discussion started by: LessNux
10 Replies
7. Shell Programming and Scripting
I need to remove ] followed by newline character to convert lines like:
line1]
line2
into:
line1line2 (4 Replies)
Discussion started by: locoroco
4 Replies
8. Shell Programming and Scripting
Hi
I have a folder that contain up to 1000 subfolder. Genereally i need just 2 or 3 of them and i can know apriori the name of the subfolder i want to keep.
I'd like to erase all the unnecessary subfolders.
I've tried with:
ls -l | awk '$8 !~ /name_fold/{print "rm -r " $8}'| sh
and it... (4 Replies)
Discussion started by: Dedalus
4 Replies
9. Shell Programming and Scripting
I have two files which are of the following format:
File1:
Unnamed
Unnamed
Boston
Unnamed
New_York
Unnamed
File2:
San_Francisco
Chicago
Portland
Austin
Orlando
Los_Angeles
In the case where an entry in File1 is "Unnamed", I want to output the name from the same line in File2.... (5 Replies)
Discussion started by: forthekill
5 Replies
10. Shell Programming and Scripting
Hi,
For my bash script, terminal with bash is generate an OK output and program works right.
already,
terminal with ash have "line 48: syntax error: Bad substitution" output and program don't work.
:confused: (0 Replies)
Discussion started by: s. murat
0 Replies