Ok. If you are going to be on Unix some time then use a standard technique. Make directory "~/bin" and add it to your PATH. In ~/.profile add:
Every long enough command convert to script. For example in a text editor make such file:
Then name it. You should check that the name doesn't collide with some unix command with:
Then put this file in your ~/bin directory and add execution permission to it:
Of course, you should test it and you can tweak it (there are useful advises in this topic).
If you need another command, add it. There maybe two or two hundred - no differences. And if you want just this particular output add this in script and use it:
Write your scripts as simple as possible. Of course you can use something like this:
but this doesn't matter. Use what you understand.
About su and your access rights. Your need to read some good introductory book on UNIX. There are a lot, I read and liked "Think UNIX". And "Unix and Linux: Visual QuickStart Guide (4th Edition)" is good one too (and maybe a little easier)."
I'm trying to learn about regular expressions. Let's say I want to list all the files in /usr/bin beginning with "p", ending with "x", and containing an "a".
I know this works:ls | grep ^p | grep x$ | grep abut I'm thinking there must be a way to do it without typing grep three times. Some of my... (9 Replies)
Hi everyone,
I'm new to the forums, as you can probably tell... I'm also pretty new to scripting and writing any type of code.
I needed to know exactly how I can grep for multiple strings, in files located in one directory, but I need each string to output to a separate file.
So I'd... (19 Replies)
Since there are approximately 75K gsfiles and hundreds of stfiles per gsfile, this script can take hours. How can I rewrite this script, so that it's much faster? I'm not as familiar with perl but I'm open to all suggestions.
ls file.list>$split
for gsfile in `cat $split`;
do
csplit... (17 Replies)
Greetings!
I have been tasked to create a report off files we receive from our hardware suppliers. I need to grep these files for two fields 'Test_Version' and 'Model-Manufacturer' ; for each field, I need to capture their corresponding values.
When running each statement separately, I get... (4 Replies)
Hello everyone.
I wrote the following script but the second part is not excecuting. It is not sending the notification by email if the error occurs.
the send mail is working so i think the errorr should be in the if statement
LOGDIR=/logs/out
LOG=`date "+%Y%m%d"`.LOG-FILE.out #the log file ... (11 Replies)
Dear all
i am having text file like
xxx|yyy|1|2|
zzz|rrr|3|4|
www|xxx|><
5|6|><
jjj|kkk|><
8|9><
i want to join two lines which are having ' >< ' by taking only two lines at a stretch ...using awk command
the result output should be
xxx|yyy|1|2|
zzz|rrr|3|4|
www|xxx|5|6|... (2 Replies)
Hi
I am having text file like this
001|ramu|hno221|><
sheshadripuram|delhi|560061><
002|krishna|hno225|><
newdelhimain|delhi|560061><
i want to combine every two lines as single...line...
i.e
001|ramu|hno221|sheshadripuram|delhi|560061
can u pls help me (3 Replies)
I have a command that does something and then creates a log file (importlog.xml).
I then want to grep that newly created log (importlog.xml) file for a certain word (success).
I then want to write that grep result to a new file (success.log).
So far I can run the command which creates the... (2 Replies)
Hi,
i tried to combine grep with find and it didnt work
grep 'find dirname filename"
i also would like that the file will be sorted in the way.
thanks a lot. (2 Replies)
Hi All ,
Any one help me to combine two files in shell scripting .Below is my requrement
i have 2 files as follows
filea
newyork America
Texas America
london Engalad
Fileb
abc
def
xyz
i have to combine this file as follows
newyork America abc
Texas ... (1 Reply)