Here is another example you could try, all in bash shell without external utilities or subshells except for the mv command, so it should be reasonably quick.
It also does not entirely produce the proper output format:
, but it should give you some idea..
Remove the echo statement when it does what you want...
Last edited by Scrutinizer; 06-25-2019 at 04:50 PM..
This User Gave Thanks to Scrutinizer For This Post:
Hi,
I need a help in deleting a line matching a particular pattern in a file using shell script without opening the file. The file is a .c/.cpp file. Is it possible?
Thanks (6 Replies)
hi ,
i need a shell script that will remove the first and second lines of the text file
and will list the word count of the characters present in it.
the text file will be consisting of multiple textfiles.the first text file starts from
01-34.like wise the next file also starts from 01-34... (4 Replies)
Hi,
iam presenting the input text file format.Of this i need the character count of the number of characters present in each file.The attached file is a combination of 3 text file.each text file starts at record 1 - 34, then the next tetx file starts. What i need is the character count of each... (1 Reply)
Hi,
Can someone help me with this small piece of code.
DIRNAME=$(dirname $0)
BASENAME=$(basename $0)
DATA="${DIRNAME}/${BASENAME}.data"
&& . $DATA
whats is meant by && . $DATA here...
Regards,
Abhishek (2 Replies)
I searched the forum, but there was different type of rename.
Hello.
I have files in folder.
Like:
xxxxxxxx1.html
or
xxxxxxxx2.txt
or
xxxxxxxx3.tar.gz
and how to rename or change file extension case to
xxxxxxxx1.htm
or
xxxxxxx2.TXT
or (5 Replies)
hi,
I need some help in writing shell script in a bourne shell.I am trying to rename the file..
eg.
find /root/data -type f -name "text*) | while read FILES
do
newfile=${FILES/type_2.0_20101208_34.xml / tmp.xml}
mv "$FILES" "$newfile"
done
above written script is working...If the... (7 Replies)
Dear All
I have a filelisting as below:
abcd_20110715_0007
abcd_20110715_0010
abcd_20110716_0001
abcd_20110716_0004
abcd_20110715_0008
abcd_20110715_0011
abcd_20110716_0002
abcd_20110716_0005
abcd_20110715_0009
abcd_20110715_0012
abcd_20110716_0003
abcd_20110716_0006
... (3 Replies)
Hi,
My input file as follws
$ cat 1.txt
-------
a aa aaa 11
b bb bbb 22
I am able to extract first and last column of a given line as follows.
$ nawk '{print $1}' FS= RS= 1.txt | awk '{ $NF = ""; print }'
a
$ nawk '{print $1}' FS= RS= 1.txt | awk '{ print $NF}'
11
however, the... (4 Replies)
Hi,
I need shell script for getting the date in format from below text output
IP IS 10.238.52.65
pun-ras-bng-mhs-01#show conf port 2/4
Building configuration...
Current configuration:
!
card ge3-4-port 2
!
port ethernet 2/4
no shutdown
encapsulation dot1q (7 Replies)
Discussion started by: surender reddy
7 Replies
LEARN ABOUT DEBIAN
moon-buggy
moon-buggy(6) Games Manual moon-buggy(6)NAME
moon-buggy - drive some car across the moon
SYNOPSIS
moon-buggy [-hnsV] [--help] [--no-title] [--show-scores] [--version]
DESCRIPTION
Moon-buggy is a simple character graphics game, where you drive some kind of car across the moon's surface. Unfortunately there are dan-
gerous craters there. Fortunately your car can jump over them!
OPTIONS
The program understands the following command line options.
-h, --help
shows a short usage message.
-m, --mesg
disable write access to your terminal by other users, so your boss can't disturb your game play with the help of "write" or "fin-
ger".
-n, --no-title
skips the title screen.
-s, --show-scores
shows the current highscore list and exits.
-V, --version
prints the program's version to standard output and exits.
KEYS
The moon-buggy is controlled by a couple of keys, which are described near the bottom of the screen. Most important are the following
keys.
SPC, j makes your car jump. The length of a jump is fixed and you can only start a new jump, while the wheels have contact to the ground.
a, l fires the mining laser. The laser is used to remove stones, which may block your way.
q quits the game prematurely. But you still keep your score and may enter the highscore list.
FILES
The following files on your system are related to moon-buggy.
/usr/games/moon-buggy
the moon-buggy executable.
/var/games/moon-buggy/mbscore
the global score file
$HOME/.mbscore
the local score file. This is used, if moon-buggy has no write access to the global score file.
SEE ALSO
Moon-buggy Usage and Maintenance by Jochen Voss.
COPYING
Copyright (C) 2004 Jochen Voss
Moon-buggy is free software. Read the file COPYING of the source code distribution for details or press 'c' at moon-buggy's title screen.
AUTHOR
The program moon-buggy was implemented by Jochen Voss (voss@seehuhn.de).
moon-buggy 1.0.51+esd Dec 27 2004 moon-buggy(6)