Sponsored Content
Full Discussion: use of hyphen in #! line
Top Forums Shell Programming and Scripting use of hyphen in #! line Post 302112426 by bigearsbilly on Wednesday 28th of March 2007 04:33:40 AM
Old 03-28-2007
I don't think it serves any useful purpose.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

add a hyphen every 2 characters of every line

I have a text file like this with hundreds of lines: >cat file1.txt 1027123000 1027124000 1127125000 1128140000 1228143000 > all lines are very similar and have exactly 10 digits. I want to separate the digits by twodigit and hyphens....like so, > 10-27-12-30-00 10-27-12-40-00... (7 Replies)
Discussion started by: ajp7701
7 Replies

2. Shell Programming and Scripting

Hyphen char after shebang notation

Hi, I have a trivial question to ask, I am seeing in some shell scripts the '-' (hyphen) character following the first line of shell script (i.e) the shebang notation as follows: #!/bin/sh - #! /bin/bash - what does the hyphen signify? What will happen if it is not given explicitly? (2 Replies)
Discussion started by: royalibrahim
2 Replies

3. UNIX Desktop Questions & Answers

How to remove text in each line after hyphen?

Hi, I'm trying to do something relatively simple. I have a txt file that has the following kinds of lines (and many more lines): CP19 Oahu - Maunawili Falls CP20 Oahu - Maunawili Falls AG12 Oahu - Maunawili Falls CP22 Oahu - Maunawili Falls, Local area AG14 Oahu CP141 KZ102 Kauai -... (7 Replies)
Discussion started by: euspilapteryx
7 Replies

4. Shell Programming and Scripting

delete the last hyphen

I want to check for more than one hyphen and then hold the first one and delete the rest of the hyphen. I try something like this sed 's/\(*\)\1/\1/' but this doesn't work. I try something like this sed 's/\(*\)-\1/ \1/g' but here the script delete all the hyphen. I want to go from this : I... (2 Replies)
Discussion started by: thailand
2 Replies

5. Shell Programming and Scripting

awk - replace first hyphen

How do I use awk to replace the first hyphen of a specific record? (1 Reply)
Discussion started by: locoroco
1 Replies

6. Shell Programming and Scripting

Grep command to ignore line starting with hyphen

Hi, I want to read a file line by line and exclude the lines that are beginning with special characters. The below code is working fine except when the line starts with hyphen (-) in the file. for TEST in `cat $FILE | grep -E -v '#|/+' | awk '{FS=":"}NF > 0{print $1}'` do . . done How... (4 Replies)
Discussion started by: Srinraj Rao
4 Replies

7. Shell Programming and Scripting

sed - replacing a substring containing a hyphen

I'm attempting to replace a substring that contains a hyphen and not having much success, can anyone point out where i'm going wrong or suggest an alternative. # echo /var/lib/libvirt/images/vm888b-clone.qcow | sed -e 's|vm888-clone|qaz|g' /var/lib/libvirt/images/vm888b-clone.qcow (1 Reply)
Discussion started by: squrcles
1 Replies

8. Shell Programming and Scripting

Insert a hyphen between two delimiters using sed

Hey guys, I have a file that is delimited by | and I am trying to write a sed command to convert this: abc|def||ghi|jkl||||mnop into this: abc|def|-|ghi|jkl|-|-|-|mnop The output I am getting out of: sed -e "s/+//g" /tmp/opt.del > /tmp/opt2.del is like: ... (9 Replies)
Discussion started by: prohank
9 Replies

9. Shell Programming and Scripting

Replacing space with hyphen in a pattern.

I have a huge text file, about 52 GB. In the file, there are patterns like these: ] ] ] ]One can see that there is text within patterns such as and ], and I am only interested in ]. There is text before and after all these patterns too, for example, ''Anarchism''' is a ] that advocates ]... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

10. UNIX for Beginners Questions & Answers

Deleting directory with leading hyphen in name

I asked this question last month in Stack Exchange (linux - delete directory with leading hyphen - Server Fault) and none of the answers supplied worked. I have somehow created a directory with a leading hyphen and cannot get rid of it. # ls -li | grep p 2621441 drwxr-xr-x. 2 root root... (4 Replies)
Discussion started by: edstevens
4 Replies
pbm(5)                                                          File Formats Manual                                                         pbm(5)

NAME
pbm - portable bitmap file format DESCRIPTION
The portable bitmap format is a lowest common denominator monochrome file format. It serves as the common language of a large family of bitmap conversion filters. Because the format pays no heed to efficiency, it is simple and general enough that one can easily develop pro- grams to convert to and from just about any other graphics format, or to manipulate the image. This is not a format that one would normally use to store a file or to transmit it to someone -- it's too expensive and not expressive enough for that. It's just an intermediary format. In it's purest use, it lives only in a pipe between two other programs. The format definition is as follows. A PBM file consists of a sequence of one or more PBM images. There are no data, delimiters, or padding before, after, or between images. Each PBM image consists of the following: - A "magic number" for identifying the file type. A pbm image's magic number is the two characters "P4". - Whitespace (blanks, TABs, CRs, LFs). - The width in pixels of the image, formatted as ASCII characters in decimal. - Whitespace. - The height in pixels of the image, again in ASCII decimal. - Newline or other single whitespace character. - A raster of Height rows, in order from top to bottom. Each row is Width bits, packed 8 to a byte, with don't care bits to fill out the last byte in the row. Each bit represents a pixel: 1 is black, 0 is white. The order of the pixels is left to right. The order of their storage within each file byte is most significant bit to least significant bit. The order of the file bytes is from the beginning of the file toward the end of the file. - Characters from a "#" to the next end-of-line, before the width/height line, are comments and are ignored. There is actually another version of the PBM format, even more more simplistic, more lavishly wasteful of space than PBM, called Plain PBM. Plain PBM actually came first, but even its inventor couldn't stand its recklessly squanderous use of resources after a while and switched to what we now know as the regular PBM format. But Plain PBM is so redundant -- so overstated -- that it's virtually impossible to break. You can send it through the most liberal mail system (which was the original purpose of the PBM format) and it will arrive still readable. You can flip a dozen random bits and easily piece back together the original image. And we hardly need to define the format here, because you can decode it by inspection. The difference is: - There is exactly one image in a file. - The "magic number" is "P1" instead of "P4". - Each pixel in the raster is represented by a byte containing ASCII '1' or '0', representing black and white respectively. There are no fill bits at the end of a row. - White space in the raster section is ignored. - You can put any junk you want after the raster, if it starts with a white space character. - No line should be longer than 70 characters. Here is an example of a small bitmap in the plain PBM format: P1 # feep.pbm 24 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 You can generate the Plain PBM format from the regular PBM format (first image in the file only) with the pnmtoplainpnm program. Programs that read this format should be as lenient as possible, accepting anything that looks remotely like a bitmap. COMPATIBILITY
Before July 2000, there could be at most one image in a PBM file. As a result, most tools to process PBM files ignore (and don't read) any data after the first image. SEE ALSO
libpbm(3),pnm(5),pgm(5),ppm(5) AUTHOR
Copyright (C) 1989, 1991 by Jef Poskanzer. 05 March 2000 pbm(5)
All times are GMT -4. The time now is 09:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy