09-04-2010
The ll command + metacharacters
Hello. I am learning how to use Unix through an online course. Unfortunately the text that we use isn't very good, so I could use some help with a pretty basic question.
- Use metacharacters and the ll command to list all filenames under the datafiles directory that contain a dot "." with the letter 'a' anywhere after the dot.
So far, I've figured out
But I'm not sure how to look for a character after the dot. For that mater, I'm not sure how to list files containing a certain character. I know that
will list files beginning with a, and that using brackets will list a range of characters, but neither of those is what I'm looking for.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there a way to use metacharacters in a loop or in an if.
I want to allow a user to enter Y, y, Yes, yes, Yah, etc...
in a loop I tried:
read response
while *" ]
do........
and
while *" ]
do .........
this works for grep or egrep but not in loops
Why?????? (4 Replies)
Discussion started by: jrdnoland1
4 Replies
2. UNIX for Dummies Questions & Answers
I want to display an asterisk to the screen as part of a string. I know how to use the Backslash to escape it's value. But how do I display it without showing the Backslash? (1 Reply)
Discussion started by: regencyabs
1 Replies
3. Shell Programming and Scripting
Hello,
I have a question, please (I am using tcsh).
I thought that if you enclose something in double quotes, then the shell won't interpret it. For example, when I do:
% echo "ls *"
I get
ls *
However, if I do:
% echo "!l"
I get
echo "ls -F"
ls -F (3 Replies)
Discussion started by: A1977
3 Replies
4. Shell Programming and Scripting
:confused:Hi ,
Can someone please advise what is the meaning of metacharacters in below code?
a_PROCESS=${0##*/}
a_DPFX=${a_PROCESS%.*}
a_LPFX="a_DPFX : $$ : "
a_UPFX="Usage: $a_PROCESS"
Regards,
gehlnar (3 Replies)
Discussion started by: gehlnar
3 Replies
5. Shell Programming and Scripting
I'm trying to create a bash script that takes a URL as one of its arguments like this:
./script.sh http://url.cfm?asdf&asdf=234
variable=$1
echo $variable
I'm having trouble storing the URL because it contains the meta character "&" which is being interpreted... thus when I run the... (4 Replies)
Discussion started by: kds1398
4 Replies
6. Shell Programming and Scripting
If I have a filename as
filename.txt.20090807
and I use
for FILE in `find . -name "filename*" -type f`
do
my_time=${FILE#./filename.txt.}
I get my output as 20090807
However if my filename is
filename.Y20090807.txt
Is there a way I can use metacharacters in my... (3 Replies)
Discussion started by: RubinPat
3 Replies
7. Shell Programming and Scripting
I have prepared a script to submit a string in a txt file.
However there are somethings that I have to check before submitting the string in the txt file.
One of those checks is to determine whether the string entered contains any metacharacters.
I have tried sth like;
echo "string" | grep -v ... (3 Replies)
Discussion started by: ozum
3 Replies
8. UNIX for Dummies Questions & Answers
1) I want to display all the files in a directory that start with the word chapter, are followed by a digit 1,2,6,8, or 9 and end with .eps or .prn
so I came up with this
file ~/temp/chapter.eps ~/temp/chapter.prn
but is there a better way, i.e. combining both file types into the command?
... (2 Replies)
Discussion started by: dunsta
2 Replies
9. Shell Programming and Scripting
I have a file which contains a list of paths separated by a new line character.
e.g
/some/path/to/a/file.png
/some/path to/another/file.jpeg
/some path/to yet/another/file
Notice that these paths may contain metacharacters, the spaces for example are also not escaped.
If I wanted... (5 Replies)
Discussion started by: cue
5 Replies
10. UNIX for Dummies Questions & Answers
Hello, I'm new to command line coding (and coding in general) and have run into a problem. I'm using awk to perform a global find and replace in a text file in the Terminal provided by Mac.
Here is a sample of my textfile where the fields are separated by tabs.
1Ps 1,1 VWB/(J VWB VWB... (7 Replies)
Discussion started by: jvoot
7 Replies
RSH(1) BSD General Commands Manual RSH(1)
NAME
rsh -- remote shell
SYNOPSIS
rsh [-Kdnx] [-l username] host [command]
DESCRIPTION
Rsh executes command on host.
Rsh copies its standard input to the remote command, the standard output of the remote command to its standard output, and the standard error
of the remote command to its standard error. Interrupt, quit and terminate signals are propagated to the remote command; rsh normally termi-
nates when the remote command does. The options are as follows:
-d The -d option turns on socket debugging (using setsockopt(2)) on the TCP sockets used for communication with the remote host.
-l By default, the remote username is the same as the local username. The -l option allows the remote name to be specified.
-n The -n option redirects input from the special device /dev/null (see the BUGS section of this manual page).
If no command is specified, you will be logged in on the remote host using rlogin(1).
Shell metacharacters which are not quoted are interpreted on local machine, while quoted metacharacters are interpreted on the remote
machine. For example, the command
rsh otherhost cat remotefile >> localfile
appends the remote file remotefile to the local file localfile, while
rsh otherhost cat remotefile ">>" other_remotefile
appends remotefile to other_remotefile.
FILES
/etc/hosts
SEE ALSO
rlogin(1),
HISTORY
The rsh command appeared in 4.2BSD.
BUGS
If you are using csh(1) and put a rsh in the background without redirecting its input away from the terminal, it will block even if no reads
are posted by the remote command. If no input is desired you should redirect the input of rsh to /dev/null using the -n option.
You cannot run an interactive command (like rogue(6) or vi(1)) using rsh; use rlogin(1) instead.
Stop signals stop the local rsh process only; this is arguably wrong, but currently hard to fix for reasons too complicated to explain here.
Linux NetKit (0.17) August 15, 1999 Linux NetKit (0.17)