10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have four files:
test
test2
test3
test4
I have this simple script:
#!/bin/bash
ls $1
Why does ./the_script.sh test* only list the first file, when a normal ls test* would list all four? What do I need to change in the script to be able to use wildcard? (12 Replies)
Discussion started by: KidCactus
12 Replies
2. Shell Programming and Scripting
Does anyone know how I would go about inserting text at the beginning of a file with the file name containing a daily time stamp? Essentially I need to find the file name using a wild card, and then insert 3 lines of text - one of which is the processing date. Help please!? (1 Reply)
Discussion started by: cookie33
1 Replies
3. UNIX for Advanced & Expert Users
These 2 websites do a GREAT job of explaining different types of wildcards. I learned about the categories of characters which I never knew about at all.
GNU/Linux Command-Line Tools Guide - Wildcards
GREP (1 Reply)
Discussion started by: cokedude
1 Replies
4. UNIX for Dummies Questions & Answers
Im going insane trying to figure out what i consider a basic command on an SFTP server...
Im trying to download all files from a directory *done*
then remove all the files (and sometimes folders that contain files) i have downloaded on the remote directory...
the command i would normally... (2 Replies)
Discussion started by: mokachoka
2 Replies
5. Shell Programming and Scripting
Good evening All,
I have a perl script to pull out all occurrences of a files beginning with xx and ending in .p. I will then loop through all 1K files in a directory. I can grep for xx*.p files but it gives me the entire line. I wish to output to a single colum with only the hits found. ... (3 Replies)
Discussion started by: CammyD
3 Replies
6. UNIX for Dummies Questions & Answers
find ./ -name t\* | sed "s@^./@@" > .filestobedeleted
j=$(wc -l < .filestobedeleted)
typeset -i cnt=0
typeset -i i=0
while read line
do
myarray=$line
((cnt = cnt + 1))
done < .filestobedeleted
while (1 Reply)
Discussion started by: aishu
1 Replies
7. UNIX for Dummies Questions & Answers
Hi All
Please excuse another straightforward question. When creating a tar archive from a directory I am attempting to use wildcards to eliminate certain filetypes (otherwise the archive gets too large). So I am looking for something along these lines.
tar -cf archive.tar * <minus all *.rst... (5 Replies)
Discussion started by: C3000
5 Replies
8. UNIX for Dummies Questions & Answers
ok, I'm trying to write a script file that lists files with specific elements in the name into a txt file, it looks like this
ls s*.dat > file_names.txt
can't figure out whats wrong with that line, any ideas?
thanks in advance (10 Replies)
Discussion started by: benu302000
10 Replies
9. UNIX for Dummies Questions & Answers
when writing a shell script (bourne) and using a unix command like 'ls' is there anything special you need to do to use a wildcard (like *)? (3 Replies)
Discussion started by: benu302000
3 Replies
10. UNIX for Dummies Questions & Answers
I'm trying to delete lines from a large text file using VI.
Every line that I am wanting to delete start with 'S' - all others do not. (A list of users)
I've tried using * but doesn't seem to like it...any ideas...
Doesn't have to be VI - but I'm better with VI than sed/awk. (8 Replies)
Discussion started by: peter.herlihy
8 Replies