Search Results

Search: Posts Made By: umar.shaikh
10,031
Posted By umar.shaikh
Ah. Thanks! :) Geez! I really need to get my...
Ah. Thanks! :)
Geez! I really need to get my eyes checked! :)

Thanks for the tip too! Really helps!
10,031
Posted By umar.shaikh
Problem with nested if...elif..else
Hi,

I'm developing a script which will have a lot of options to be checked for and will be setting things / doing further things accordingly.

I'm using a LOT of nested if, elif, else throughout...
Forum: Red Hat 03-13-2012
9,885
Posted By umar.shaikh
Any suggestions on this?
Any suggestions on this?
Forum: Red Hat 03-08-2012
9,885
Posted By umar.shaikh
Nope. It has only a 'search domain.com' and...
Nope.
It has only a 'search domain.com' and other nameserver lines within it.
Forum: Red Hat 03-07-2012
9,885
Posted By umar.shaikh
Problems with DHCP_HOSTNAME for RHEL5 and RHEL6
Hi folks,

I have a weird problem.

I'm doing guest customization for Linux guests. During this process, I change the hostname, etc. For changing the hostname, I edit the /etc/sysconfig/network...
3,254
Posted By umar.shaikh
Sorry I forgot to mention that this would be a...
Sorry I forgot to mention that this would be a dangerous script! :) Thanks for chipping in methyl
51,915
Posted By umar.shaikh
Ok. So if an input file looks like this: ...
Ok. So if an input file looks like this:

Column01 Column02 Column03
Column11 Column12 Column13
Column21 Column22 Column23

Then you have 2 ways of doing this:
1. Do it by reading the file...
1,662
Posted By umar.shaikh
You're doing an echo filename here :) you need to...
You're doing an echo filename here :) you need to do a cat filename.
TABLENAME=`cat $inputFILE | awk '{print $1}'`

Say if the file is something like this:
Table1 Column1
Table2 Column2
Table3...
51,915
Posted By umar.shaikh
What is it that you're trying to achieve here?...
What is it that you're trying to achieve here? Can you give an example?
You want to search something from the first 2 lines? And also the first column entirely?

You would be better off using awk...
3,254
Posted By umar.shaikh
Login as root and do a ps -ef You could also...
Login as root and do a ps -ef
You could also grep for the specific process that you are looking out for and also directly fetch the PID directly. The second column is usually the PID.
So:...
2,149
Posted By umar.shaikh
Nope. I don't think that it would mount it as a...
Nope. I don't think that it would mount it as a different filesystem.
When you mount the flash drive, make sure that you're giving the type as ntfs-3g. It's also always good to check if the drive is...
2,094
Posted By umar.shaikh
Which shell are you running? Date manipulation is...
Which shell are you running? Date manipulation is not the easiest thing to do in Unix. There have been multiple posts on this within these forums.
Check this...
18,989
Posted By umar.shaikh
:) you're not doing anything that requires a...
:) you're not doing anything that requires a loop! Remove the while loop and your problems are solved!
4,507
Posted By umar.shaikh
The simplest way is to catch the exit code of...
The simplest way is to catch the exit code of script B.
Put this line in your 'main' script just after you call script B
#Main Script
./scriptB
EXIT_CODE=`echo $?`
if [ $EXIT_CODE -ne 0 ]
then...
17,232
Posted By umar.shaikh
I had mentioned this earlier in my post. To get...
I had mentioned this earlier in my post. To get the individual parts via cut, do the following:

PART_1=`echo $FILE_SHORT_NAME | cut -d'_' -f1`
PART_2=`echo $FILE_SHORT_NAME | cut -d'_' -f2`...
17,232
Posted By umar.shaikh
I can think of a quick way to do this via 'cut'. ...
I can think of a quick way to do this via 'cut'.
The first part would be to get rid of the file extension:
FILE_SHORT_NAME=`echo $FILE_NAME | cut -d'.' -f1`

The next would be to split the...
1,116
Posted By umar.shaikh
Once you are in the foobar folder, you can use: ...
Once you are in the foobar folder, you can use:
pwd | awk '{print $NF}'
to get the folder name. i.e. foobar.

You can apply the same logic to get the '.1' part of the file name.
Once you've got...
4,275
Posted By umar.shaikh
For using Kanji characters, I believe that you...
For using Kanji characters, I believe that you would need to set PuTTY to UTF-8 first. Open a new PuTTY window, go to the Window -> Translation section and change the character set to UTF-8....
2,495
Posted By umar.shaikh
Oh. I should have mentioned it more explicitly. ...
Oh. I should have mentioned it more explicitly.
If you look carefully, the sed quotes that I use are double quotes and not single.
If you want to use variables with sed, you should be using double...
1,705
Posted By umar.shaikh
If you have created a file earlier, your output...
If you have created a file earlier, your output redirector would be something like
echo $birthday >> file

A '>' would wipe out an entire file and create it all over again. A '>>' would append to...
2,495
Posted By umar.shaikh
Just use it like: sed -i...
Just use it like:
sed -i "s/$GMAILID/test@gmail.com/" /home/$USER/Desktop/sendmail
1,507
Posted By umar.shaikh
Those are some long questions :) I'll attempt...
Those are some long questions :)
I'll attempt the first. It sounds fairly simple.
You need to get the current time stamp in your initial script and pass that as an argument to your 3 scripts....
3,477
Posted By umar.shaikh
Does your Windows box have Japanese fonts...
Does your Windows box have Japanese fonts enabled? You might want to check that.
Are the characters coming up like rectangular boxes? If thats the case, I guess you need Japanese fonts on your...
37,468
Posted By umar.shaikh
I just tried to run the command that you have...
I just tried to run the command that you have given.

cat filename | grep ^PenaltyError:= | cut -d '@' -f1 | cut -d ' ' -f8

It runs just fine without any problems. And so does

cat filename |...
4,173
Posted By umar.shaikh
Yep.. there is.. pulled it from another thread...
Yep.. there is..
pulled it from another thread (https://www.unix.com/unix-dummies-questions-answers/19779-help-multiple-file-rename-change-case-part-file-name.html)..

for filename in *;
do
...
Showing results 1 to 25 of 32

 
All times are GMT -4. The time now is 03:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy