How to disable backslash in command line


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to disable backslash in command line
# 8  
Old 03-16-2011
Quote:
Originally Posted by subbu62
Thanks for your reply.
Here my aim is -- i have to prevent the users from executing
some commands using backslash in the command prompt.
Could you modify the commands themselves, so that they can't avoid running the originals? Or are they not shell scripts?

---------- Post updated at 01:37 PM ---------- Previous update was at 01:34 PM ----------

Quote:
Originally Posted by subbu62
Just now i found one solution.
pl. tell me whether it is ok

creating another alias as below
alias \\exec_script exit
Will it serve my purpose
They can just find another way around it. The fully qualified path will still bypass it. So will a relative path. You can't block them all without changing how the underlying program works, I think.

---------- Post updated at 01:41 PM ---------- Previous update was at 01:37 PM ----------

Another way to do it might be to prevent everyone from using it unless they run it through sudo as a specific user. You can configure sudo to only allow them to run it when they give very specific parameters. Be careful what user sudo allows them to run it as of course.
# 9  
Old 03-16-2011
let me try it tomorrow.

thanks a lot to Corona, Scottn and Unix Forum

bye from
subbu
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Disable a command

I need to disable a command. For example - disabling "ls" means that when someone type "ls" - nothing happens . Somebody help ???? :confused::confused::confused: (8 Replies)
Discussion started by: bobochacha29
8 Replies

2. OS X (Apple)

Disable / mute microphone from command line

Googling suggested "osascript -e 'set volume 0' " but that doesn't work. I know I'd found this before... some command-line utility that had something to do with audio, mixers, whatever, but I forgot to keep it somewhere I could find it. I did find references to writing an AppleScript app, but... (3 Replies)
Discussion started by: jnojr
3 Replies

3. UNIX for Dummies Questions & Answers

Replace backslash at the end of the string using sed command

I have text file which is a tab delimited one. Sample data from the file is shown below: unix is\ great\ os linux\ is superb I want to replace that backslash with empty string preserving the tab delimiter. Output should be unix is great os linux is ... (3 Replies)
Discussion started by: p.akhilreddy4u
3 Replies

4. Red Hat

command line tool to disable screen lock and/or screen saver

Hi, I have a simple question : how to disable screen lock and/or sreen saver with command line with RHEL5.4 ? (1 Reply)
Discussion started by: albator1932
1 Replies

5. Shell Programming and Scripting

gawk (dos) insert backslash at end of line

I have created with the DOS-command dir a list of a directory. Directory of C:\Users\User\Documents 09.06.2011 20:50 48.322 file1.txt 02.11.2010 23:00 9.216 file2.txt 15.12.2010 21:06 26.793 file2.txt Now i would like to add the directory ahead of the filename. Therefore a... (6 Replies)
Discussion started by: sdf
6 Replies

6. Shell Programming and Scripting

How to retain backslash in a line while reading a data file?

Hello Firends I have a file that contains data within single quotes, which has meaning of its own. When I am trying to parse through the file for a different functionality I noticed that I was loosing the backslash when occurrences in the file look like ('\0'). I would want to retain the... (3 Replies)
Discussion started by: easwam
3 Replies

7. UNIX for Dummies Questions & Answers

What prefix backslash does to command

In unix when I run rm command, it asks for file removal confirmation e.g. rm netmail_log.csv rm: remove netmail_log.csv (yes/no)? n But if i prefix backslash to rm it does not ask for confirmation. Does anyone know what backslash does to command or shell ? e.g. \rm netmail_log.csv (1 Reply)
Discussion started by: Devdatta
1 Replies

8. UNIX for Dummies Questions & Answers

Backslash in find command

When I run my script in debug mode I see that \ is not getting executed as part of command. It is being treated as escape character. find ${DATABASE_PARAM_PATH} -mtime +${RETENTION_PERIOD} -exec rm -rf {} \; Command execution output in debug mode : find... (1 Reply)
Discussion started by: findprakash
1 Replies

9. Shell Programming and Scripting

ignoring backslash while executing command

Hi, I'm running into following issue, my_file is a collection of windows directories (i.e \\path\directory\file) . I need to be able to execute "my command" as my command \\path\directory\file I know that while read -r / print -r ignores backslashes. My code: cat $my_file | while read -r... (6 Replies)
Discussion started by: agalkin
6 Replies

10. UNIX for Advanced & Expert Users

Disable the `rm -f ` command

I wish to learn how to use the alias command in .cshrc I need to change some Unix commands, like : change "rm -f " into "rm -i " or to write small scripts using alias. (7 Replies)
Discussion started by: kamil
7 Replies
Login or Register to Ask a Question