Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Trimming a file from command prompt! Post 302478104 by nixhead on Tuesday 7th of December 2010 06:55:09 AM
Old 12-07-2010
Trimming a file from command prompt!

I have a text file. I want the top 100 lines of this file to be deleted that too from command line using minimum command input.
Please tell!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

trimming a file...

Hi everyone I have this script that appends a line to a file to log the running status of an application. I need to write another script to run as a scheduled job in cron to trim the first x number of lines of this file. Could someone give me an idea how to do this? Regards (1 Reply)
Discussion started by: alwayslearningunix
1 Replies

2. SuSE

inconsistent ls command display at the command prompt & running as a cron job

Sir, I using the following commands in a file (part of a bigger script): #!/bin/bash cd /opt/oracle/bin ls -lt | tail -1 | awk '{print $6}' >> /tmp/ramb.out If I run this from the command prompt the result is: 2007-05-16 if I run it as a cron job then... (5 Replies)
Discussion started by: rajranibl
5 Replies

3. UNIX for Dummies Questions & Answers

trimming whitespaces in a file

Hello, Im trying write a bash sript to search a file and identify any file names that contain a space at the end of them. I was trying to use the grep command but I can find how I would identify the character I'm looking for. Any help would be grately appreciated. (2 Replies)
Discussion started by: gintreach
2 Replies

4. UNIX for Dummies Questions & Answers

running command prompt executable file in shell script

hi i have file extentioned with test.vbs. i am able to run this file n execute through command promt but i dont know how to run in shell script example: file name is test.vbs which contains strSoundFile = "C:\windows\Media\Notify.wav" Set objShell = CreateObject("Wscript.Shell") strCommand... (5 Replies)
Discussion started by: atl@mav
5 Replies

5. Shell Programming and Scripting

Trimming fields for comma or pipe seperated file

I have file like this FileA: abc , "helloworld" , america def,asia, japan ghi, africa, ipl Output Needed: abc,"helloworld",america def,asia,japan ghi,africa,ipl I would like to implement using awk. I want to trim each field for its leading and trailing spaces. (7 Replies)
Discussion started by: pinnacle
7 Replies

6. Shell Programming and Scripting

need a script to redirect the command prompt data int a log file.

Hello forum memebers, I have to write a script to copy command arguments into a log.please see the below issue and help me to complete it. i have command "mkidcfg" it is custiomized.I will run the command with one arguments . mkidcfg -I _config.db_ids it will open the below options. 1... (2 Replies)
Discussion started by: rajkumar_g
2 Replies

7. Shell Programming and Scripting

need to add user from command prompt not to open actual file

Here is my script which gives the below output when I run.First it will display the list of all groups and then ask for enter the group name and after it will ask for contribuotors or users then I will add contribuotirs or users and it will show the list of all users associated with that group but... (3 Replies)
Discussion started by: rohit22hamirpur
3 Replies

8. UNIX Desktop Questions & Answers

Can Unix access Windows' File through Command Prompt in Unix

Hi all, I wish to know whether Unix can access window's file in Unix's terminal? Apart from that, how to copy files or share files between Window and Unix? I get to know of secure copy, however, my company's Unix does not support the feature of secure copy? Any other method for me to share/... (5 Replies)
Discussion started by: jessy83
5 Replies

9. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies

10. UNIX for Beginners Questions & Answers

XFCE Desktop - trash, cannot execute file, command prompt here missing.

Hi there, I am using the xfce4 is already the newest version (4.12.5). thunar is already the newest version (1.8.4-1). The distribution is Linux kali 4.19.0-kali1-amd64 #1 SMP Debian 4.19.13-1kali1 (2019-01-03) x86_64 GNU/Linux However, the problem is: When I when I click on any program to... (2 Replies)
Discussion started by: alvinoo
2 Replies
cdc(1)							      General Commands Manual							    cdc(1)

Name
       cdc - change delta commentary of an SCCS file

Syntax
       cdc -rSID [-m[mrlist]]  [-y[comment]] files

Description
       The command changes the delta commentary of each named SCCS file, for the SID specified by the -r option.

       The  delta  commentary  is  defined to be the Modification Request (MR) and comment information usually specified by the command (-m and -y
       options).

       The commentary may consist of one or more lines, terminated by a dot in column one of a new line.

       If a directory is named, behaves as though each file in the directory were specified as a named file, except non-SCCS files (last component
       of the path name does not begin with s.)  and unreadable files, which are silently ignored.  If a name of - is given, the standard input is
       read (see RESTRICTIONS).  Each line of the standard input is taken to be the name of an SCCS file to be processed.

       Arguments to which may appear in any order, consist of option arguments, and file names.

       All the described option arguments apply independently to each named file.

Options
       -m[mrlist]     Adds or deletes modification numbers.  If the SCCS file has the v flag set then a list of MR  numbers  to  be  added  and/or
		      deleted  in the delta commentary of the SID specified by the -r option may be supplied.  For further information, see A null
		      MR list has no effect.

		      MR entries are added to the list of MRs in the same manner as that of In order to delete an MR, precede the MR  number  with
		      the  character  ! (see Examples).  If the MR to be deleted is currently in the list of MRs, it is removed and changed into a
		      comment line.  A list of all deleted MRs is placed in the comment section of the delta commentary and is preceded by a  com-
		      ment line stating that they were deleted.

		      If  -m  is not used and the standard input is a terminal, the prompt MRs?  is issued on the standard output before the stan-
		      dard input is read.  If the standard input is not a terminal, no prompt is issued.  The MRs? prompt always precedes the com-
		      ments? prompt (see -y option).
		      MRs in a list are separated by blanks and/or tab characters.  An unescaped new-line character terminates the MR list.

		      Note  that  if  the v flag has a value it is taken to be the name of a program (or shell procedure) which validates the cor-
		      rectness of the MR numbers.  For further information, see If a nonzero exit status is returned from the MR number validation
		      program, terminates and the delta commentary remains unchanged.

       -rSID	      Specifies the SCCS Identification string of a delta for which the delta commentary is to be changed.

       -y[comment]    Replaces	existing  commentary  for  the delta specified by the -r option.  The previous comments are kept and preceded by a
		      comment line stating that they were changed.  A null comment has no effect.

		      If -y is not specified and the standard input is a terminal, the prompt comments? is issued on the  standard  output  before
		      the standard input is read; if the standard input is not a terminal, no prompt is issued.  A dot in column one of a new line
		      terminates the comment text.

       Certain permissions are necessary to modify the SCCS file; generally, however, if you made the delta, you can change its delta  commentary,
       and if you own the file and directory you can modify the delta commentary.

Examples
       This example shows how to add bl78-12345 and bl79-00001 to the MR list, remove bl77-54321 from the MR list, and add the comment ``trouble''
       to delta 1.6 of s.file.
       sccscdc -r1.6 -m"bl78-12345 !bl77-54321 bl79-00001" -ytrouble .file

       This example does the same thing.
       sccscdc -r1.6 .file

       -MRs? !bl77-54321 bl78-12345 bl79-00001

       comments? trouble

Restrictions
       If SCCS file names are supplied to the command via the standard input (- on the command line), then the -m and  -y  options  must  also	be
       used.

Diagnostics
       See for explanations.

Files
       For more information, see

       For more information, see

See Also
       admin(1), delta(1), get(1), help(1), prs(1), sccs(1), sccsfile(5)
       Guide to the Source Code Control System

																	    cdc(1)
All times are GMT -4. The time now is 09:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy