Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script batch with command sed Post 302867831 by yo-yo78 on Friday 25th of October 2013 05:42:00 AM
Old 10-25-2013
the substrig is the first n characters

the string of files is every different and contain 1 line but different length
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using Batch command

Hi All I have a need due time constraint to issue the mail command in background. I have a script that sends a message to a mail address as follows :- echo "$MLINE" | mail -s "$HOST - $TEXT" name@co.com & The script runs frequently and I check to see if the script is active and if it is , it... (5 Replies)
Discussion started by: jhansrod
5 Replies

2. UNIX for Dummies Questions & Answers

batch command in a shell script

How do I execute a batch command from a script, which "waits" with the next command until the first one has finished? ======= A piece of my script looks like this: #!/bin/sh (...) # run a long batch job: ./run_calculation.sh # then rename resulting file: mv output.dat backup.dat (...) ... (7 Replies)
Discussion started by: ivvo
7 Replies

3. Shell Programming and Scripting

su command in batch mode

Hi, how do we change user in a shell script- batch mode. Thanks, Rajesh (3 Replies)
Discussion started by: Rajesh Gohad
3 Replies

4. UNIX for Dummies Questions & Answers

batch file using sed command in msdos

<! pad_meth: <! program = "/usr/lib/drivers/pse/x29d -p" how should i program it in oder to display this: <! pad_meth: <! program = "/usr/lib/drivers/pse/x29d -p" ;) (1 Reply)
Discussion started by: rita1985
1 Replies

5. Shell Programming and Scripting

use sed do batch wildcard string replace

Hi, Here is what I want to do I want to search local directory and its sub directory, all the files which contain any string like _12345, then remove this string. String is a combination of _ plus a random integer number. For example, here is one line in a file before <properties... (1 Reply)
Discussion started by: bp5000
1 Replies

6. Shell Programming and Scripting

try to batch rename using sed (if this is best)

hi gooday I need some help with a rename I am attempting. I'd like to rename a bunch of files in a folder example list.dat.old to list_N.dat query.dat.old to query_N.dat note the two periods in (.dat.old) to become _N.dat I tried using sed like this ls *.dat.old | sed... (3 Replies)
Discussion started by: johnstrong
3 Replies

7. Shell Programming and Scripting

Sed or awk for batch replace file name

Can you please point me in the correct direction? I need a line or script to run though a given directory and find all files with "@domain.local" in there names and simple remove that. For example if the files were named 1234@domain.local the file would then become 1234. (1 Reply)
Discussion started by: binary-ninja
1 Replies

8. Shell Programming and Scripting

Executing a batch of files within a shell script with option to refire the individual files in batch

Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below. I am on a solaris server btw. Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose. ... (2 Replies)
Discussion started by: goddevil
2 Replies

9. UNIX for Advanced & Expert Users

Batch SFTP command Help

I need to run a test SFTP command in a batch mode and what I need to prompt my password after the sftp userid@hostname. I do not have have an ssh key exchanged between my server and the external server. I only have access to it as an sftp server. I must enter my password in my script. How do i... (2 Replies)
Discussion started by: mrn6430
2 Replies

10. Shell Programming and Scripting

sed batch file issue

Hi!! I want to create a batch file so the sh file could change a file on a specific time. I made this config: sed -i 's/range 192.168.1.200 192.168.1.220;/option POLYCOM "tftp://10.20.1.10";/g' /etc/dhcp3/dhcpd.conf My issue is that the sed does not accept the :// character.... (2 Replies)
Discussion started by: jocas9
2 Replies
wc(1)								   User Commands							     wc(1)

NAME
wc - display a count of lines, words and characters in a file SYNOPSIS
/usr/bin/wc wc [-c | -m | -C] [-lw] [file]... ksh93 wc [-c | -m | -C] [-lLqw] [file]... DESCRIPTION
/usr/bin/wc wc reads one or more input files and, by default, writes the number of NEWLINE characters, words and bytes contained in each input file to the standard output. wc also writes a total count for all named files, if more than one input file is specified. wc considers a word to be a non-zero-length string of characters delimited by white space (for example, SPACE, TAB). See iswspace(3C) or isspace(3C). ksh93 The wc built-in in ksh93 is associated with the /bin and /usr/bin paths. It is invoked when wc is executed without a pathname prefix and the pathname search finds a /bin/wc or /usr/bin/wc executable. wc reads one or more input files and, by default, for each file writes a line containing the number of NEWLINEs, words, and bytes contained in each file followed by the file name to standard output in that order. A word is defined to be a non-zero length string delimited by iss- pace(3C) characters. If more than one file is specified, wc writes a total count for all of the named files with total written instead of the file name. By default, wc writes all three counts. Options can specified so that only certain counts are written. The -c, -C, and -m options are mutu- ally exclusive. If no file is specified, or if the file is -, wc reads from standard input and no filename is written to standard output. The start of the file is defined as the current offset. -c --bytes | chars List the byte counts. -l --lines List the line counts. -L --longest-line | max-line-length List the longest line length. -m | C --multibyte-chars List the character counts. -q --quiet Suppress invalid multi-byte character warnings. -w --words List the word counts. OPTIONS
The following options are supported: -c Counts bytes. -C Same as -m. -l Counts lines. -m Counts characters. -w Counts words delimited by white space characters or new line characters. Delimiting characters are Extended Unix Code (EUC) charac- ters from any code set defined by iswspace(). If no option is specified, the default is -lwc (counts lines, words, and bytes.) OPERANDS
The following operand is supported: file A path name of an input file. If no file operands are specified, the standard input is used. USAGE
See largefile(5) for the description of the behavior of wc when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of wc: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: /usr/bin/wc +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |Standard |See standards(5). | +-----------------------------+-----------------------------+ ksh93 +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |See below. | +-----------------------------+-----------------------------+ The ksh93 built-in binding to /bin and /usr/bin is Volatile. The built-in interfaces are Uncommitted. SEE ALSO
cksum(1), ksh93(1), isspace(3C), iswalpha(3C), iswspace(3C), setlocale(3C), attributes(5), environ(5), largefile(5), standards(5) SunOS 5.11 13 Mar 2008 wc(1)
All times are GMT -4. The time now is 04:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy