Sponsored Content
Top Forums Shell Programming and Scripting Silly newbie question on special characters! Post 302129813 by earnstaf on Wednesday 1st of August 2007 06:52:53 PM
Old 08-01-2007
Quote:
Originally Posted by charliemp3
Hello again Gurus,
Can someone please direct me to an online source that specifically explains what characters like [ ! # {} ] mean within if statements? or scripts in general, I have found information about the different letter options you can specify for an if statment, but I get really confused with the ! in front of a -f or particularly this if [ $# -lt 1 ] at the beginning of a script when there have been no variables set.

I've learned the basic purpose of an if statement and case statement sort of, but the special characters are somehow omitted from the sources I've been looking at.

Any source for dummies or idiots like myself would be great!

Thanks so much.

Charlie.Smilie
This is a pretty extensive list/explanation of special characters:
http://www.tldp.org/LDP/abs/html/special-chars.html

As for:
Code:
if [ $# -lt 1 ]

$# indicates the number of command line arguments, so it's saying if there is less than 1 do something (probably exit with a usage message.)
 

10 More Discussions You Might Find Interesting

1. Solaris

Silly question

Are GNOME or javadsktop supported of the box on Solaris 10 on Ultra (SUNBlade 1500) ? I'could switch desktops to KDE at CDE logon. But when I tried to use the JavaDesktop it simply returns me back to the log on screen of CDE. How do I conigure to the latest GNOME and.or JavaDesktop if... (3 Replies)
Discussion started by: miket
3 Replies

2. Solaris

Silly Cdrom burn question

Probably a silly question but one I dont know the answer to all the same.. I downloaded the following from sun - solaris 9 part 1 of the software sol-9-u7-sparc-v1.zip When I unzip it I get an iso file. How do I burn it to a cdrom and be able to insert it to solaris machine so that it will... (3 Replies)
Discussion started by: frustrated1
3 Replies

3. UNIX for Dummies Questions & Answers

Silly question about a process

I know its kinda silly but I've seen the texts consider one side - a thread executes and finishes its task but I was wondering what will happen if the process dies when the thread is still under execution... I somehow think that the thread will continue execution but am backing off from the fact... (10 Replies)
Discussion started by: Legend986
10 Replies

4. UNIX for Dummies Questions & Answers

silly question

How do I go about finding the number of unique words in a file. (3 Replies)
Discussion started by: EECSDAVE
3 Replies

5. UNIX for Dummies Questions & Answers

Silly question on printing for loop in AWK

Hi, One silly question. I would like to add statement like below and append to a file. I used the below code; however, it does not work. Can anyone please tell me what mistakes I have made? awk ' { for (i=1;i<=563;i++) print i }'>>output.txt Thanks. -Jason (1 Reply)
Discussion started by: ahjiefreak
1 Replies

6. Solaris

Silly question regarding SSH.

Hi Guys, I have installed SSH package on server as well as clients. I think I need to these steps next. Login as root on the server. 1) ssh-keygen -b 1024 -t rsa -f /etc/ssh_hosts_key.pub -N " " Login to root as the user. 2)ssh_keygen -b 1024 -t rsa Enter the phrase Basically this... (3 Replies)
Discussion started by: nitinkgoud
3 Replies

7. UNIX for Dummies Questions & Answers

silly question ..

hi all last week i had appeared for an interview where they asked me as u work on windows & unix tell me what are the advantages of UNIX over windows & vice versa ..i gave 2-3 reasons but when i told that unix is more secure than windows he asked me how ? i was speechless. then i googled about... (6 Replies)
Discussion started by: zedex
6 Replies

8. Solaris

I have a silly question

Can anyone tell me where is the best place to put my own system related scripts on a solaris server. I usually place my scripts in /usr/sbin/<my_name>, but that is only because my senior sysadmin used to do that. What does the "unix etiquette" say? (8 Replies)
Discussion started by: soliberus
8 Replies

9. Shell Programming and Scripting

A silly question

FILENAME is a variable. Is there really any difference between "$FILENAME.sh" and "$FILENAME".sh ? (5 Replies)
Discussion started by: proactiveaditya
5 Replies

10. Post Here to Contact Site Administrators and Moderators

Might be silly question

Hi Team, In case if i want to delete one of my posting thread.. can i delete that? Just asking to know.. (5 Replies)
Discussion started by: darling
5 Replies
LDP Introduction(ldp)													     LDP Introduction(ldp)

NAME
LDP - Intro to the Linux Documentation Project, with help, guides and documents SYNOPSIS
The Linux Documentation Project (LDP) provides a variety of free documentation resources including guides, FAQs, HOWTOs, and man-pages to the Linux community. AUTHORS
The various documents in the LDP archives are maintained by individual authors, and are listed in the beginning of each HOWTO. If you have any questions or inputs to a document we encourage you to contact the authors directly. WEB PAGES
The LDP has its own dedicated web site as do many of the various translations projects which are linked from the main LDP web site at http://www.LinuxDoc.org/ which you may wish to bookmark. MAN PAGES
A web page with status information for manual pages and translations is found at http://www.win.tue.nl/~aeb/linux/man/ MAILING LISTS
LDP has a number of mailing lists, mostly of use to authors: <ldp-announce@lists.LinuxDoc.org> Announcements from the LDP project <ldp-discuss@lists.LinuxDoc.org> General discussion on the LDP project To join these lists send a mail with a body of "subscribe" to <ldp-announce-request@lists.LinuxDoc.org> or <ldp-discuss-request@lists.Lin- uxDoc.org> respectively. These mailing lists are also archived at the LinuxDoc site. FILES
Most distributions include the HOWTOs and mini-HOWTOs in the installation /usr/doc/ (old place for documentation) /usr/share/doc/ (new place for documentation) /usr/share/doc/HOWTO/ (HOWTO files) /usr/share/doc/HOWTO/mini/ (mini-HOWTO files) SEE ALSO
man(1), xman(1x), info(1) info pages as read with emacs(1) or info(1) LDP
2001-11-15 LDP Introduction(ldp)
All times are GMT -4. The time now is 06:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy