Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Suggestions on where to begin? Post 12395 by odinwolph on Friday 28th of December 2001 03:46:15 PM
Old 12-28-2001
Hi ITDrew

Well I hope this post doesn't come to late.

MY sugestion for you would be to start with learning unix. And after that start with the programming part.

Unix is after all quite different from Windows and MacOS. So I personaly wouldn't recomend that you would start to learn to program in unix and learn unix at the same time. These kind of things take some time. Java would have been a good place to start programming since it is platform independant. But that is another story. (But worth looking into since the step from C/C++ isn't that big. Another reason is if you will be working on many different platforms (operating systems) it is quite handy not having to rewrite the program intirely to be able to use it.)

OK... I'm leaving the subject now....

Simple version of what I want to say to you:

Learn Unix first and after that learn how to program in that environment.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

BEGIN END questions

Why would you need to use this in a script? Why can't you just use print to print out what you want printed in the begining and print for what you want at the end. So this: nawk 'BEGIN {print "this is the first line"} {print $1 $2 $3} {print $5 $6} END {print "this is the last line"}' ... (2 Replies)
Discussion started by: llsmr777
2 Replies

2. UNIX for Dummies Questions & Answers

Need help begin with unix.

so im new :) i whant to use and learn UNIX, but i dont know annythign about the system. so i need some help getting started :) (5 Replies)
Discussion started by: Morton
5 Replies

3. Shell Programming and Scripting

begin end detection

Hi all, i am new to scripting. i need to write a code to detect begin and end of word that either begins or ends with t,th,d,dh,s,sh i have a set of words in a file containg one word per line. let the filename be aaa.txt. i have an another file bbb.txt which has two lines, just specifying the... (7 Replies)
Discussion started by: blkanth
7 Replies

4. Shell Programming and Scripting

BEGIN Clause Help Needed

what does this clause means in UNIX 'BEGIN { FS="|";OFS="|" } the complete clause is like find . -name $filename | xargs awk -v s1=$String1 -v s2=$String2 -v s3=$String3 -v s4=$String4 'BEGIN { FS="|";OFS="|" } Please advice. (2 Replies)
Discussion started by: jojo123
2 Replies

5. Shell Programming and Scripting

awk getting stuck after BEGIN

I am beginner in awk awk 'BEGIN{for(i=1;(getline<"opnoise")>0;i++) arr=$1}{print arr}' In the above script, opnoise is a file, I am reading it into an array and then printing the value corresponding to index 20. Well this is not my real objective, but I have posted this example to describe... (1 Reply)
Discussion started by: akshaykr2
1 Replies

6. Shell Programming and Scripting

Deleting rows that begin with #

Hi, I have a file that has rows that start with # and ends with #. For example.. # hi text JK NM JK NM JK K JK NM # no # yes So I want to remove the #'s and put them into another file. so the output will be two files.. File 1: JK NM JK NM JK K JK NM (3 Replies)
Discussion started by: phil_heath
3 Replies

7. Shell Programming and Scripting

awk BEGIN problem

awk 'BEGIN { print "line one\nline two\nline three" }' After ./awktest.sh Usage: awk -f progfile file ... Usage: awk 'program' file ... POSIX options: GNU long options: -f progfile --file=progfile -F fs --field-separator=fs -v var=val ... (7 Replies)
Discussion started by: cola
7 Replies

8. Shell Programming and Scripting

Perl: Question about 'BEGIN'

Newbie question, not sure of the use of BEGIN when you can just have the enclosed code inserted before the remaining program which means that code will get executed first anyway? (2 Replies)
Discussion started by: stevensw
2 Replies

9. UNIX for Dummies Questions & Answers

awk search with begin

Hi, I have written below script to begin if the line has n #!/bin/ksh /usr/xpg4/bin/awk {/ n / 'BEGIN {X = "01"; X = "02"; X = "03"; X = "04"; X = "05"; X = "06"; X = "07"; X = "08"; X ="09"; X = "10"; X = "11"; X = "12"; };} NR > 1 {print $1 "\t" $5 "," X "," $6 " " $7}'} input.txt |... (9 Replies)
Discussion started by: stew
9 Replies

10. Shell Programming and Scripting

Awk: BEGIN: prints nothing

My code fails to do anything if I've BEGIN block in it: Run the awk script as: awk -f ~/bin/sum_dupli_gene.awk make_gene_probe.txt #!/usr/bin/awk -f BEGIN { print ARGV #--loads of stuff } END{ #more stuff } (14 Replies)
Discussion started by: genome
14 Replies
os(3erl)						     Erlang Module Definition							  os(3erl)

NAME
os - Operating System Specific Functions DESCRIPTION
The functions in this module are operating system specific. Careless use of these functions will result in programs that will only run on a specific platform. On the other hand, with careful use these functions can be of help in enabling a program to run on most platforms. EXPORTS
cmd(Command) -> string() Types Command = string() | atom() Executes Command in a command shell of the target OS, captures the standard output of the command and returns this result as a string. This function is a replacement of the previous unix:cmd/1 ; on a Unix platform they are equivalent. Examples: LsOut = os:cmd("ls"), % on unix platform DirOut = os:cmd("dir"), % on Win32 platform Note that in some cases, standard output of a command when called from another program (for example, os:cmd/1 ) may differ, compared to the standard output of the command when called directly from an OS command shell. find_executable(Name) -> Filename | false find_executable(Name, Path) -> Filename | false Types Name = string() Path = string() Filename = string() These two functions look up an executable program given its name and a search path, in the same way as the underlying operating sys- tem. find_executable/1 uses the current execution path (that is, the environment variable PATH on Unix and Windows). Path , if given, should conform to the syntax of execution paths on the operating system. The absolute filename of the executable program Name is returned, or false if the program was not found. getenv() -> [string()] Returns a list of all environment variables. Each environment variable is given as a single string on the format "VarName=Value" , where VarName is the name of the variable and Value its value. getenv(VarName) -> Value | false Types VarName = string() Value = string() Returns the Value of the environment variable VarName , or false if the environment variable is undefined. getpid() -> Value Types Value = string() Returns the process identifier of the current Erlang emulator in the format most commonly used by the operating system environment. Value is returned as a string containing the (usually) numerical identifier for a process. On Unix, this is typically the return value of the getpid() system call. On VxWorks, Value contains the task id (decimal notation) of the Erlang task. On Windows, the process id as returned by the GetCurrentProcessId() system call is used. putenv(VarName, Value) -> true Types VarName = string() Value = string() Sets a new Value for the environment variable VarName . timestamp() -> {MegaSecs, Secs, MicroSecs} Types MegaSecs = Secs = MicroSecs = int() Returns a tuple in the same format as erlang:now/0 . The difference is that this function returns what the operating system thinks (a.k.a. the wall clock time) without any attempts at time correction. The result of two different calls to this function is not guaranteed to be different. The most obvious use for this function is logging. The tuple can be used together with the function calendar:now_to_universal_time/1 or calendar:now_to_local_time/1 to get calendar time. Using the calendar time together with the MicroSecs part of the return tuple from this function allows you to log timestamps in high resolution and consistent with the time in the rest of the operating system. Example of code formatting a string in the format "DD Mon YYYY HH:MM:SS.mmmmmm", where DD is the day of month, Mon is the textual month name, YYYY is the year, HH:MM:SS is the time and mmmmmm is the microseconds in six positions: -module(print_time). -export([format_utc_timestamp/0]). format_utc_timestamp() -> TS = {_,_,Micro} = os:timestamp(), {{Year,Month,Day},{Hour,Minute,Second}} = calendar:now_to_universal_time(TS), Mstr = element(Month,{"Jan","Feb","Mar","Apr","May","Jun","Jul", "Aug","Sep","Oct","Nov","Dec"}), io_lib:format("~2w ~s ~4w ~2w:~2..0w:~2..0w.~6..0w", [Day,Mstr,Year,Hour,Minute,Second,Micro]). The module above could be used in the following way: 1> io:format("~s~n",[print_time:format_utc_timestamp()]). 29 Apr 2009 9:55:30.051711 type() -> {Osfamily, Osname} | Osfamily Types Osfamily = win32 | unix | vxworks Osname = atom() Returns the Osfamily and, in some cases, Osname of the current operating system. On Unix, Osname will have same value as uname -s returns, but in lower case. For example, on Solaris 1 and 2, it will be sunos . In Windows, Osname will be either nt (on Windows NT), or windows (on Windows 95). On VxWorks the OS family alone is returned, that is vxworks . Note: Think twice before using this function. Use the filename module if you want to inspect or build file names in a portable way. Avoid match- ing on the Osname atom. version() -> {Major, Minor, Release} | VersionString Types Major = Minor = Release = integer() VersionString = string() Returns the operating system version. On most systems, this function returns a tuple, but a string will be returned instead if the system has versions which cannot be expressed as three numbers. Note: Think twice before using this function. If you still need to use it, always call os:type() first. Ericsson AB kernel 2.14.3 os(3erl)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy