create a file called -a


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers create a file called -a
# 1  
Old 03-12-2011
Data create a file called -a

Can I create a file called '-a' in unix.Or can i open it with vi ?

vi \-a will give u an error that -a is invalid option for vi.
# 2  
Old 03-12-2011
methyl showed us this trick a little while ago. vi ./-a

Some programs also accept the special -- argument that forces it to interpret following arguments as not-switches.
# 3  
Old 03-12-2011
And another way:

Code:
vi -- -a

The double hyphen "ends the options". (Quote from "man ksh"). Works with many commands including "rm".
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to pass the config file lines as variable on the respective called function on a script

I want to make a config file which contain all the paths. i want to read the config file line by line and pass as an argument on my below function. Replace all the path with reading config path line by line and pass in respective functions. how can i achieve that? Kindly guide. ... (6 Replies)
Discussion started by: sadique.manzar
6 Replies

2. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

3. Shell Programming and Scripting

Need output of script on screen and file with correct return status of the called script.

Hi, I am trying to capture logs of the script in the file as well as on the screen. I have used exec and tee command for this. While using exec command I am getting the correct output in the file but, script output is not getting displayed on the screen as it get executed. Below is my sample... (14 Replies)
Discussion started by: Prathmesh
14 Replies

4. Shell Programming and Scripting

Simple sh called by PHP to create users HELP

Hello! Im trying to create a shell script that will be executed by PHP like: $return = shell_exec("./makeUser.sh $user $pass"); My shell script looks like: #!/bin/bash NAME=$1 PWD=$2 pass=$(perl -e 'print crypt($ARGV, "password")' $PWD) useradd -m -p $pass $NAME && echo "0" ||... (2 Replies)
Discussion started by: blak422
2 Replies

5. Shell Programming and Scripting

Remove file called "-X"??

Hi all, So I have found a file literally called "-X" in a folder, that is preventing me from using any meaningful commands in that folder because, as I understand it, at command runtime it will convert any wildcard characters into matching filenames, thus a command such as: ls *Ends up actually... (7 Replies)
Discussion started by: dan-e
7 Replies

6. UNIX for Advanced & Expert Users

Rename file called "-X"??

Hi all, So I have found a file literally called "-X" in a folder, that is preventing me from using any meaningful commands in that folder because, as I understand it, at command runtime it will convert any wildcard characters into matching filenames, thus a command such as: ls *Ends up... (1 Reply)
Discussion started by: dan-e
1 Replies

7. Shell Programming and Scripting

how to split this file into blocks and then send these blocks as input to the tool called Yices?

Hello, I have a file like this: FILE.TXT: (define argc :: int) (assert ( > argc 1)) (assert ( = argc 1)) <check> # (define c :: float) (assert ( > c 0)) (assert ( = c 0)) <check> # now, i want to separate each block('#' is the delimeter), make them separate files, and then send them as... (5 Replies)
Discussion started by: paramad
5 Replies

8. Shell Programming and Scripting

Identify env file called

Hi, please help me.. in how to find out which env file is being called upon when an os user logs. when i su - oracle , i would like to know which env is called, because i see many env files under the home dir.. thanks, (2 Replies)
Discussion started by: jjoy
2 Replies

9. Shell Programming and Scripting

Remove a file called -r using rm

Is there any way to remove a file named "-r" using "rm", because "rm" assumes that file is one of it's options if I type "rm -r" and then throws an error message? I also tried "rm -r -r" and that didn't work either. (3 Replies)
Discussion started by: dkieran
3 Replies
Login or Register to Ask a Question