Sponsored Content
Top Forums Shell Programming and Scripting Use "read" with a text file with comments Post 67957 by zazzybob on Tuesday 29th of March 2005 07:25:52 PM
Old 03-29-2005
An alternative solution using case...
Code:
#!/bin/sh

while read PC USER PASS SHARE EXCL
do
  case $PC in
    "#"*) # comment - ignore
          ;;
    *) echo $PC $USER $PASS $SHARE $EXCL
          ;;
  esac
done < logfile

exit 0

Cheers
ZB
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to request a "read" or "delivered" receipt for mails

Dears, I've written a script which allows me to send mails in different formats with different attaches. Now I still want to add a feature to this script. My users would like to be able to receive a "read" or "delivered" receipt for their mails. The script send mails on behalve of an specific... (1 Reply)
Discussion started by: plelie2
1 Replies

2. Shell Programming and Scripting

read -p "prompt text" foo say "read: bad option(s)" in Bourne-Shell

Hallo, i need a Prompting read in my script: read -p "Enter your command: " command But i always get this Error: -p: is not an identifier When I run these in c-shell i get this error /usr/bin/read: read: bad option(s) How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Shell Programming and Scripting

Purpose of "read" and "$END$" in ksh ?

Hi, Could anyone please shed some light on the following script lines and what is it doing as it was written by an ex-administrator? cat $AMS/version|read a b verno d DBVer=$(/usr/bin/printf "%7s" $verno) I checked that the cat $AMS/version command returns following output: ... (10 Replies)
Discussion started by: dbadmin100
10 Replies

5. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

6. Shell Programming and Scripting

Read from "list1" and list matches in "list2"

I want to print any matching IP addresse in List1 with List 2; List 1 List of IP addresses; 161.85.58.210 250.57.15.129 217.23.162.249 74.76.129.101 30.221.177.237 3.147.200.59 170.58.142.64 127.65.109.33 150.167.242.146 223.3.20.186 25.181.180.99 2.55.199.32 (3 Replies)
Discussion started by: lewk
3 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
FUSESMB.CONF(5) 						File Formats Manual						   FUSESMB.CONF(5)

NAME
fusesmb.conf - the configuration file for fusesmb FILE FORMAT
The file consists of sections and parameters. A section begins with the name of the section in square brackets and continues until the next section begins. Sections contain parameters of the form: name = value. The file is line-based - that is, each newline-terminated line represents either a comment, a section name or a parameter. Section and parameter names are not case sensitive. Only the first equals sign in a parameter is significant. Whitespace before or after the first equals sign is discarded. Leading, trailing and internal whitespace in section and parameter names is irrelevant. Leading and trailing whitespace in a parameter value is discarded. Internal whitespace within a parameter value is retained verbatim. Any line beginning with a semicolon (``;'') or a hash (``#'') character is ignored, as are lines containing only whitespace. SPECIAL SECTIONS
fusesmb.conf can contain the following sections: The [global] section Section for global parameters. The [ignore] section Section for specifying servers and/or workgroups that should not be listed. The [/SERVER] section Section for server-specific settings. The section name should start with a slash ``/'' and not end with a slash. The [/SERVER/SHARE] Section for share-specific settings. The section name should start with a slash followed by the server name followed by a slash end- ing on the share name. It should not end with a slash. EXPLANATION OF EACH PARAMETER
This chapter explains each possible option. The section names - specified between parentheses after each option - shows the applicable sec- tions for this option. For example: ( [global] ) specifies that this option is only possible for the section [global]. ignore ( [/SERVER] ) Ignore this server. Possible values are: true, false, 1 and 0. Example: ignore = true interval ( [global] ) Interval for scanning the network for shares. Value is a number that specifies the network scanning interval in minutes. If the value is smaller or equal to zero the network is not scanned. Example: interval = 20 password ( [global], [/SERVER], [/SERVER/SHARE] ) Password. Value is string containing the password. Example: password = secret servers ( [ignore] ) Servers to ignore. Value is each server to ignore separated by a comma. Example: servers = SERVER1, SERVER2, SERVER3 showhiddenshares ( [global], [/SERVER] ) Show hidden shares. Possible values are: true, false, 1 and 0. Example: showhiddenshares = false timeout ( [global] ) Connection timeout in seconds. A server after this timeout is considered offline. Values smaller than 2 seconds are ignored. Example: timeout = 10 username ( [global], [/SERVER], [/SERVER/SHARE] ) Username. Value is string containing the username. Example: username = johndoe workgroups ( [ignore] ) Workgroups to ignore. Value is each workgroup to ignore separated by a comma. Example: workgroups = WORKGROUP1, WORKGROUP2 EXAMPLE
; Global settings [global] ; Default username and password username=user password=totallysecret ; List hidden shares showhiddenshares=true ; Connection timeout in seconds timeout = 10 ;Interval for updating new shares in minutes interval = 10 ; Section for servers and/or workgroups to ignore [ignore] servers=SERVER,SERVER2,SERVER3 workgroups=WORKGROUP,WG2 ; Share-specific settings [/SERVER/SHARE] username=john password=doe ; Server-specific settings [/SERVER] username=jane password=doe showhiddenshares=true ignore=true SEE ALSO
fusesmb(1) AUTHOR
Vincent Wagelaar <vincent@ricardis.tudelft.nl>. August 5, 2005 FUSESMB.CONF(5)
All times are GMT -4. The time now is 06:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy