Solved

shell syntax and file copy syntax AIX IBM

Posted on 2014-02-12
3
532 Views
Last Modified: 2014-02-12
what does the # character represent in an AIX IBM shell command?

Also can you give an example of how to copy the contents of an AIX IBM file into a text file via a shell command?
0
Comment
Question by:pma111
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 500 total points
ID: 39853096
# generally represents a comment
#!  however is called shebang and tells the script location of the interpreter
eg  #!/bin/ksh

if you want to copy file
cp filename newfilename

Or

cat filename > newfilename
0
 
LVL 3

Author Comment

by:pma111
ID: 39853106
if you ran

# grep SYSTEM /etc/security/user > 123.txt within a shell, would it work, or would the # comment out the command?

or put another way would
grep SYSTEM /etc/security/user >123.txt

work / run ok?
0
 
LVL 31

Expert Comment

by:farzanj
ID: 39853117
On the shell, if you are hitting the enter/return key and you get #, I think you are talking about the prompt sign

You can change it if you say

PS1="> "

To change it to > if you like.

Yes, if you are putting # yourself, that would comment it and it would therefore not run.

grep SYSTEM /etc/security/user >123.txt   work/run

YES
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question