action command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting action command
# 1  
Old 07-27-2005
action command

Hi..

When i refered the script /etc/rc.sysinit...

i found the "action commands" like
Quote:
action $"Mounting proc filesystem: " mount -n -t proc /proc /proc
But this is not working in my shells..

the following error is coming...

Quote:
-bash: action: command not found
Please anybody help

Thanks in advance
esham
# 2  
Old 07-27-2005
Please post your OS and version. Also, is the example given,
Quote:
action $"Mounting proc filesystem: " mount -n -t proc /proc /proc
the one that is failing or is it some other line? Please provide the line that is failing and explain
Quote:
But this is not working in my shells..
- as the boot process running a shell script is not the same as a user running a shell script after the system is up.

Also see rc.sysinit script

Last edited by RTM; 07-27-2005 at 06:25 PM..
# 3  
Old 07-28-2005
My OS is RedHAT 9 kernel 2.6.10

what my problem is that i need to implement that [ OK ] like functionality in my script ..
so i refered the rc.sysinit so i found that its some command like "action" doing this..

If iam wrong,pls correct me...

esham
# 4  
Old 07-28-2005
it looks like that 'action' command is a fuction defined somewhere in another script ... Smilie
# 5  
Old 07-28-2005
here is it, partner... action is a function defined on /etc/rc.d/init.d/functions

Code:
# Run some action. Log its output.
action() {
  STRING=$1
  echo -n "$STRING "
  shift
  initlog $INITLOG_ARGS -c "$*" && success $"$STRING" || failure $"$STRING"
  rc=$?
  echo
  return $rc
}

I've found this on a RedHat 7.1, I'm pretty sure that is the same on your RH9
# 6  
Old 07-30-2005
Thank you very much for the support...
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

multiple action!

lets explain it easy by showing the initial file and desired file: I've a file such this that contains: initial_file: 31/12/2011 23:46:08 38.6762 43.689 14.16 Ml 3.1 ... (1 Reply)
Discussion started by: oreka18
1 Replies

2. Shell Programming and Scripting

Script to monitor for new file with ext .err and size > 0 bytes and perform a action or command

Hi All, I need to create a script to monitor a dir for new files with ext .err and also it should b a non empty files. and perform a action or command . We have a new ETL application that runs on a linux server, every times a etl fails it creates a .err file or updates the existing .err... (4 Replies)
Discussion started by: MAKHAN
4 Replies

3. Shell Programming and Scripting

Need help with find its action

I am writing a shell script that takes at least 2 arguments. The first is an octal representation of file permissions, the second is a command that is executed on all the files found with that permission. #!/bin/sh find . -perm $1 -exec $2 $3 $4 {} \; invoked: ./script.sh 543 ls -la what... (3 Replies)
Discussion started by: computethis
3 Replies

4. Shell Programming and Scripting

same action in then as in else: explanation?

in /etc/init.d/networking of an ubuntu computer, I found this code: if ifdown -a --exclude=lo; then log_action_end_msg $? else log_action_end_msg $? fi Shouldn't it be replace by ifdown -a --exclude=lo ... (0 Replies)
Discussion started by: raphinou
0 Replies

5. UNIX for Dummies Questions & Answers

Use pipes but miss a action

please delete and see other post. Hi, Im using awk to go through every line, but i have to use it twice as the first awk finds all the lines with a number in one field and the pipes it to wc, and the second does the same as the first but it has a extra pipe into sort and uniq that finds all... (2 Replies)
Discussion started by: fredted40x
2 Replies

6. Shell Programming and Scripting

PHP and Javascript in action

Hi all, I'm not sure in which category should I post in but I'll try in this one. Here is my problem, I'm trying to combine 2 scripts that I found useful to me. First one is this , what I'm trying to accomplish is dynamic user look up from my database. The other script is this one , this script... (0 Replies)
Discussion started by: c0mrade
0 Replies
Login or Register to Ask a Question