Sponsored Content
Full Discussion: Asking on cut script
Top Forums UNIX for Dummies Questions & Answers Asking on cut script Post 38803 by blueberry80 on Saturday 26th of July 2003 12:29:55 AM
Old 07-26-2003
Hi,
thanks for your help but when i tried out using the script :

JOB_ID=`nawk 'NR=5 {print}' ${SQL_LOG}`

to cut from this log file :

1 row updated.
1 row created.
111
----------
111
Commit complete.


it will echo out this :
1 row updated. 1 row created. 111 ---------- 111 Commit complete.

instead of just getting out the '111'.

why is it that the log file become one straight line when i echo out and i am unable to cut the 111.

Thanks !
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to cut a word from the file

hi to all i wrote a script to cut a word from the file....that works only if the word is fixed field. example.. sed -n '1p'|awk '{ print $2 }'|cut -d '(' -f2|sed 's/(//'|sed 's/)//'|sed 's/"//g' filename i know that word is starting with "app" then "(" ----> ex: app("xxxx"). it... (2 Replies)
Discussion started by: honeym210
2 Replies

2. Shell Programming and Scripting

Strange thing with 'cut' in a script

When I run the script I have just created, I get a strange scenario around the following code: echo "Check for duplicate UID's, each user should have a unique user ID (UID)" echo "IF a UID is displayed fix or document why it is required!" echo "Press enter to continue!" read a cut... (1 Reply)
Discussion started by: sport
1 Replies

3. UNIX for Dummies Questions & Answers

Cut an sql script output

Hi i want to cut the first field of this output obtained form sql script more dxlocks_test.log.1 SID SERIAL# SPID ---------- ---------- --------- 25 18356 1029 78 39370 1025 136 14361 1027 ================================ cut -f1... (2 Replies)
Discussion started by: aishwaryakala
2 Replies

4. Shell Programming and Scripting

Cut out string in bash script

Hi all, I'm trying to extract string from variable in BASH. That's probably trivial for grep but I couldn't figure it out. I want to get name, there's sometimes digit after it, but it should be left out. STRING=http://name5.domain.com:8000/file.dat Could someone help me with that? Any... (10 Replies)
Discussion started by: cootue
10 Replies

5. UNIX for Dummies Questions & Answers

How to use cut or sed for my little script.

Hello people, I have a little script that has to compare some files (exe files)... so i find all the files in the given paths (2 paths) and it generates 2 txt files (named 1.txt and 2.txt, they have to be identical) i need to have a little IF function to compare the 2 files and see if they are... (2 Replies)
Discussion started by: valiadi
2 Replies

6. Shell Programming and Scripting

Cut in shell script

Hi All, Am a Beginner to shell scripting, so please pardon my question. Below is the file format of file a.txt a.txt F=3 a|b|c|d 1|2|3|4 as|as|asd|asd Aas|as|asd|ada In the above file format, i have record count of total no of records excluding the header file here 3 , this varies... (2 Replies)
Discussion started by: sp999
2 Replies

7. Shell Programming and Scripting

Cut Command error cut: Bad range

Hi Can anyone what I am doing wrong while using cut command. for f in *.log do logfilename=$f Log "Log file Name: $logfilename" logfile1=`basename $logfilename .log` flength=${#logfile1} Log "file length $flength" from_length=$(($flength - 15)) Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies

8. Shell Programming and Scripting

Need script to cut string from a filename

Hi, I need a script which do below I have a filename: TEST2013_09_17_XX_XX_XX.csv Now script should create a new file with name: XX_XX_XX.csv Or I should say i need the output as XX_XX_XX.csv Please help. Mant thanks in advance (3 Replies)
Discussion started by: sv0081493
3 Replies

9. Shell Programming and Scripting

Using :<<cut / cut to comment out block of bash script

I am using : << cut / cut to comment out block of code. Works fine on few lines of script, then it gives me this cryptic error when I try to comment out about 80 lines. The "warning " is at last line of script. done < results 169 echo "END read all positioning parameters" 170... (8 Replies)
Discussion started by: annacreek
8 Replies
rawtoppm(1)						      General Commands Manual						       rawtoppm(1)

NAME
rawtoppm - convert raw RGB bytes into a portable pixmap SYNOPSIS
rawtoppm [-headerskip N] [-rowskip N] [-rgb|-rbg|-grb |-gbr|-brg|-bgr ] [-interpixel|-interrow] width height [imagedata] DESCRIPTION
Reads raw RGB bytes as input. Produces a portable pixmap as output. The input file is just RGB bytes. You have to specify the width and height on the command line, since the program obviously can't get them from the file. The maxval is assumed to be 255. If the resulting image is upside down, run it through pnmflip -tb . OPTIONS
-headerskip If the file has a header, you can use this flag to skip over it. -rowskip If there is padding at the ends of the rows, you can skip it with this flag. -rgb -rbg -grb -gbr -brg -bgr These flags let you specify alternate color orders. The default is -rgb. -interpixel -interrow These flags let you specify how the colors are interleaved. The default is -interpixel, meaning interleaved by pixel. A byte of red, a byte of green, and a byte of blue, or whatever color order you specified. -interrow means interleaved by row - a row of red, a row of green, a row of blue, assuming standard rgb color order. An -interplane flag - all the red pixels, then all the green, then all the blue - would be an obvious extension, but is not implemented. You could get the same effect by splitting the file into three parts (perhaps using dd), turning each part into a PGM file with rawtopgm, and then combining them with rgb3toppm. SEE ALSO
ppm(5), rawtopgm(1), rgb3toppm(1), pnmflip(1) AUTHOR
Copyright (C) 1991 by Jef Poskanzer. 06 February 1991 rawtoppm(1)
All times are GMT -4. The time now is 06:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy