Wondering why belows code works fine if i type in the command prompt but it seems not executed when i code them in a file with additional if-then-else statement.
#!/bin/sh
. $HOME/.profile
pid=`ps -ef | grep -w XELstnr | grep -v grep | awk {'print $2'}`
if
then
echo "Stopping... (2 Replies)
Dear Techs,
In the past on a different box (HP) I use to be able to complete something I was typing by entering a portion of the filename in the pwd and I would hit the Esc key and it would match the rest of the filename. I did this without understanding how it was setup.
Now I am on a new... (1 Reply)
As part of a script Im designing, I am required to allow the command line to finish off part of a series of sub-directory entries.
Basically what I want to do is
cp /root/parent/part of subs name + other part of subs name/file /other_root/other_parent/other_sub/file
without facing... (0 Replies)
Hi All,
I need to get last 7 days log entries from sulog. The same has to be done for the last command.
for ex: when i search for a user "abc" in sulog, i only want to check his entries for the last 1 week.
The same has to be done for last command.
Can anyone suggest some tips.
... (0 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
''you are missing the /home/smichaels/Labs/lab2b/group file, please create it as per step 12 of the lab.
once... (4 Replies)
Hi,
I would like to run the clear command, for every 10 times I hit the enter button. Is there a way to track the number of times the enter button is hit and run the clear command?
Thanks (2 Replies)
I need to develop a process/daemon which will constantly monitor a file for new entry and execute a command.
for eg, there is a file /var/log/inotify.log
When a new entry like below gets appeneded to this file, execute the command as follows.
/home/user/public_html/bad.php|CREATE
... (2 Replies)
Hi All,
Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries.
example:
Parent is :
----------
dn: email=yogesh.kumar@wipro.com, o=wipro, o=in
child is:
----------
dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
ExtUtils::Command(3pm) Perl Programmers Reference Guide ExtUtils::Command(3pm)NAME
ExtUtils::Command - utilities to replace common UNIX commands in Makefiles etc.
SYNOPSIS
perl -MExtUtils::Command -e cat files... > destination
perl -MExtUtils::Command -e mv source... destination
perl -MExtUtils::Command -e cp source... destination
perl -MExtUtils::Command -e touch files...
perl -MExtUtils::Command -e rm_f file...
perl -MExtUtils::Command -e rm_rf directories...
perl -MExtUtils::Command -e mkpath directories...
perl -MExtUtils::Command -e eqtime source destination
perl -MExtUtils::Command -e chmod mode files...
perl -MExtUtils::Command -e test_f file
DESCRIPTION
The module is used to replace common UNIX commands. In all cases the functions work from @ARGV rather than taking arguments. This makes
them easier to deal with in Makefiles.
perl -MExtUtils::Command -e some_command some files to work on
NOT
perl -MExtUtils::Command -e 'some_command qw(some files to work on)'
Filenames with * and ? will be glob expanded.
cat Concatenates all files mentioned on command line to STDOUT.
eqtime src dst
Sets modified time of dst to that of src
rm_rf files....
Removes directories - recursively (even if readonly)
rm_f files....
Removes files (even if readonly)
touch files ...
Makes files exist, with current timestamp
mv source... destination
Moves source to destination. Multiple sources are allowed if destination is an existing directory.
cp source... destination
Copies source to destination. Multiple sources are allowed if destination is an existing directory.
chmod mode files...
Sets UNIX like permissions 'mode' on all the files.
mkpath directory...
Creates directory, including any parent directories.
test_f file
Tests if a file exists
BUGS
Should probably be Auto/Self loaded.
SEE ALSO
ExtUtils::MakeMaker, ExtUtils::MM_Unix, ExtUtils::MM_Win32
AUTHOR
Nick Ing-Simmons <nick@ni-s.u-net.com>.
perl v5.8.0 2002-06-01 ExtUtils::Command(3pm)